When I first came into contact with webpack, I encountered several problems. After successfully installing the latest version of webpack and cli, there was a problem with the first package. In fact, it was also a syntax error
When running webpack .\src\main.js .\dist\bundle.js
and packaging, the following error occurs:
Cause of error:
The latest version of the webpack command has changed
Solution:
Add a -o
to the previous command.
run webpack .\src\main.js -o .\dist\bundle.js
Read More:
- [Solved] ERROR in ./src/main.ts Module not found: Error: Can‘t resolve ‘xxx‘
- Module not found: Error: Can‘t resolve ‘core-js/modules/es.promise.js‘ in
- [Solved] SyntaxError: E:\IdeaProject\src\main.js: Identifier ‘ElementPlus‘ has already been declared
- Solution to build error in Vue project (error in static/JS)/vendor.xxxxx.js from UglifyJs)
- [Solved] NPM node ERROR in main..js from Terser ChildProcessWorker.initialize Excaption
- Solution to some map files in JS folder after Vue packaging (remove the map. JS file)
- [Solved] Vue-cli Error: Module not found: Error: Can‘t resolve ‘vue-router ‘
- [Solved] Nuxt Import qrcodejs2.js / QRCode.js Error: document is not defined
- [Solved] This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/_@babel_runtim
- [Solved] node.js Upload Files Error: Multipart: boundary not found multer
- [Solved] Vue Project Error: Error: Cannot find module ‘webpack‘ Require stack以及Error: Rule can only have one resource so
- vue.config.js build Package UglifyJsPlugin to clear console and print console.log Error: `warnings` is not a supported option
- Node.js Error: Cannot find module express [How to Solve]
- [Solved] webpack Package Error: TypeError: this.getOptions is not a function style-loader
- [Solved] Failed to load plugin ‘vue‘ declared in ‘.eslintrc.js‘: createRequire is not a function
- [Solved] Vue uses webpack to package error: Createapp is not a function
- [Solved] mqtt.js Error: n.createConnection is not a function
- js: SyntaxError: Cannot use import statement outside a module
- Error notarget No matching version found for [email protected]. [How to Solve]
- [Solved] To install it, you can run: npm install –save core-js/modules/es.error.cause.js