Cli3.0 solution:
Failed to load resource: net::ERR_ FILE_ NOT_ FOUND
Open dist/index.html. There is a problem with the introduction
The configuration file of webpack cannot be found in the project created by Vue cli 3.0, because Vue cli 3.0 encapsulates it. You only need to modify it in the vue.config.js file in the root directory of the project (if the project does not have this file, add one directly in the root directory), and set the value of baseurl to “.”/”, as follows
const webpack = require("webpack");
module.exports = {
pluginOptions: new webpack.ProvidePlugin({
jQuery: "jquery",
$: "jquery"
}),
baseUrl: './' // Just add this line
};
Cli2. X solution:
Open the config/index. JS file and add build – > Assets public path is changed to “.”/”, that is, a dot is added in front of it
1 build: {
2 // Template for index.html
3 index: path.resolve(__dirname, '../dist/index.html'),
4
5 // Paths
6 assetsRoot: path.resolve(__dirname, '../dist'),
7 assetsSubDirectory: 'static',
8 assetsPublicPath: './', // Modify the code here
9 }
OK, 2. X 3.0 can be solved
Please indicate the source of the reprint
Similar Posts:
- Webpack 4 : ERROR in Entry module not found: Error: Can’t resolve ‘./src’
- Vue production webpack package PathError [Solved]
- Invalid configuration object. Webpack has been initialised using a..
- TypeError: CleanWebpackPlugin is not a constructor
- Causes and solutions of error reporting in require setting dynamic path
- Webpack reports an error when using the cleanwebpackplugin plug-in
- After NPM downloads a vuelazload, swipwe reports an error [Solved]
- [Solved] IView NPM run dev run error: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
- On branch master nothing to commit, working tree clean ERROR: Repository not found. fatal: Could …
- How to Solve Vue Space Line Wrap Error