-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vue cli converts all js files to typescript when adding a new plugin #5938
Labels
Comments
this is also happening for me when running 'vue add pwa' |
my temp solution for my case api.render('./template');
api.postProcessFiles(function (files) {
const fs = require('fs');
const path = require('path');
const getFiles = require('./utils/getFiles');
// get files from ./templates
const templatePath = path.resolve(__dirname, './template');
const filesFromTemplate = getFiles(templatePath)
.map(
file => file
.replace(`${templatePath}/`, '')
.replace(/^__/g, '_')
.replace(/^_/g, '.'),
);
// remove from common list and manual save
for (const path of filesFromTemplate) {
if (!files[path]) {
throw new Error(`Not found ${path} from templates`)
}
fs.mkdirSync(api.resolve(path, '../'), { recursive: true });
fs.writeFileSync(api.resolve(path), files[path], { encoding: 'utf-8' })
delete files[path];
}
}); |
Also seeing this when doing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
4.5.7
Reproduction link
https://github.com/jacekkarczmarczyk/vue-cli-bug-files
Environment info
Steps to reproduce
clone repo, add a plugin (for example
vue add router
)What is expected?
.js files stay .js
What is actually happening?
.js files are converted to .ts
It's related to #2676
However while adding a typescript plugin converting js files to ts might be justified then IMHO it doesn't seem to be the good behaviour when i'm adding unrelated plugins
The text was updated successfully, but these errors were encountered: