errored on @vue/cli 4.2.3
See original GitHub issueEnvironment
Vuejs: ^2.6.11 Vue CLI: 4.2.3 Yarn: v1.22.4
Installed packages
- @fullhuman/postcss-purgecss: ^2.1.0"
- @fullhuman/vue-cli-plugin-purgecss: ~2.1.0"
- @kazupon/vue-i18n-loader: ^0.3.0"
- @vue/cli-plugin-babel: ~4.3.0"
- @vue/cli-plugin-eslint: ~4.3.0"
- @vue/cli-plugin-pwa: ~4.3.0"
- @vue/cli-plugin-router: ~4.3.0"
- @vue/cli-plugin-vuex: ~4.3.0"
- @vue/cli-service: ~4.3.0"
- babel-eslint: ^10.1.0"
- eslint: ^6.7.2"
- eslint-plugin-vue: ^6.2.2"
- purgecss: ^2.1.2"
- sass: ^1.26.3"
- sass-loader: ^8.0.2"
- terser-webpack-plugin: ^2.3.5"
- vue-cli-plugin-i18n: ~0.6.1"
- vue-cli-plugin-webpack-bundle-analyzer: ~2.0.0"
- vue-template-compiler: ^2.6.11
Description
After adding to existing vue project the plugin via vue add @fullhuman/purgecss
and configuring the file vue.config.js with following content
const purgecss = require("@fullhuman/vue-cli-plugin-purgecss")
module.exports = {
runtimeCompiler: false,
productionSourceMap: false,
pages: {
index: {
// entry for the page
entry: 'src/main.js',
// the source template
template: 'public/index.html',
// output as dist/index.html
filename: 'index.html',
// when using title option,
// template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
title: 'Title',
// chunks to include on this page, by default includes
// extracted common chunks and vendor chunks.
chunks: []
}
},
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.plugins.push(
purgecss({
content: [
'./public/**/*.html',
"./src/**/*.vue"
],
defaultExtractor(content) {
const contentWithoutStyleBlocks = content.replace(/<style[^]+?<\/style>/gi, '')
return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || []
},
whitelist: ["html", "body"],
whitelistPatternsChildren: [/^token/, /^pre/, /^code/],
})
);
}
}
}
I execute vue-cli-service build
and I get the following error:
yarn run v1.22.4
$ vue-cli-service build
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '@fullhuman/vue-cli-plugin-purgecss'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at idToPlugin (/projects/template/node_modules/@vue/cli-service/lib/Service.js:160:14)
at Object.keys.concat.filter.map.id (/projects/template/node_modules/@vue/cli-service/lib/Service.js:199:20)
at Array.map (<anonymous>)
at Service.resolvePlugins (/projects/template/node_modules/@vue/cli-service/lib/Service.js:185:10)
at new Service (/projects/template/node_modules/@vue/cli-service/lib/Service.js:47:25)
at Object.<anonymous> (/projects/template/node_modules/@vue/cli-service/bin/vue-cli-service.js:15:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
What am I missing?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Vue CLI: Home
Create, develop and manage your projects through an accompanying graphical user interface. Future Ready. Effortlessly ship native ES2015 code for modern ...
Read more >Problem in creating new project
Vue CLI v4.2.3 ✨ Creating project in E:\VueProjects\vue-app. Initializing git repository... ⚙️ Installing CLI plugins. This might take a while... npm ...
Read more >NPM: npm peer dependency conflict - vue.js
While resolving: admin-gateway@0.0.1 npm ERR! Found: rxjs@7.3.0 npm ERR! node_modules/rxjs npm ERR! rxjs@"^6.0.0" from the root project npm ERR ...
Read more >@vue/cli - npm
Command line interface for rapid Vue.js development. Latest version: 5.0.8, last published: 2 months ago. Start using @vue/cli in your ...
Read more >Vue: Deploy failed because of "npm run build" not working?
Hi there, I'm currently working on a Vue app and to check if everything's ... 12:12:41 PM: ERR! enoent This is related to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like new versions of vue-cli are acting like vue-cli-plugin-purgecss is a vue-cli service. And so is trying to fetch it when building. I don’t see a solution to this issue on this end.
I’ll look at the vue-cli repository and add an issue to see it is or not an issue with vue-cli.
I’m waiting the solution.