We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
npm add webpack-dev-server -D
npx webpack-dev-server
"scripts": { "test": "echo \"Error: no test specified\" && exit 1", "buid": "webpack --config webpack.config.js", "dev": "webpack-dev-server" }
注:经过上面配置后,便可直接使用npm run dev运行
npm add html-webpack-plugin -D
let HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { plugins:[//数组 放着webpack所有的插件 new HtmlWebpackPlugin({ template:'./src/index.html', //作为模板文件,会向里面自动添加JS脚本 filename:'index.html', //生成的文件,但我们看不到 minify:{ //对文件进行压缩 removeAttributeQuotes:true , //删除双引号 collapseWhitespace:true //折叠空行 } }) ] }
END
by wind-jyf
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Html插件
1.所遇到的问题
2.以localhost形式打开
注:经过上面配置后,便可直接使用npm run dev运行
3.将文件均放入src中,自动添加脚本JS
END
by wind-jyf
The text was updated successfully, but these errors were encountered: