module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
]
}
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
]
}
2017-10-15
webpack 3.x es6安装及其配置
http://babeljs.io/docs/setup/#installation
http://babeljs.io/docs/setup/#installation
2017-10-15
Sublime Text3 支持Less 插件:
http://blog.csdn.net/XIAOZHUXMEN/article/details/51305659
http://blog.csdn.net/XIAOZHUXMEN/article/details/51305659
2017-10-15
var htmlWebpackPlugin = require('html-webpack-plugin');
const config={
entry: {
main: './src/script/main.js',
a: './src/script/a.js'
},
output:{
path:__dirname+'/dist/js',
filename:'[name]-[chunkhash].js'
},
plugins:[
new htmlWebpackPlugin()
]
}
module.exports=config;
const config={
entry: {
main: './src/script/main.js',
a: './src/script/a.js'
},
output:{
path:__dirname+'/dist/js',
filename:'[name]-[chunkhash].js'
},
plugins:[
new htmlWebpackPlugin()
]
}
module.exports=config;
2017-10-14
module.exports = {
entry:
{
main:'./src/script/main.js',
a:'./src/script/a.js',
},
output: {
path: __dirname+'/dist/js',
filename: '[name]-[chunkhash].js',
}
}
entry:
{
main:'./src/script/main.js',
a:'./src/script/a.js',
},
output: {
path: __dirname+'/dist/js',
filename: '[name]-[chunkhash].js',
}
}
2017-10-14
可实际上index.html文件是这样的
<<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>webpack test</title>
</head>
<body>
<script type="text/javascript" src="hello.bundle.js">
</script>
</body>
</html>
<<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>webpack test</title>
</head>
<body>
<script type="text/javascript" src="hello.bundle.js">
</script>
</body>
</html>
2017-10-14
我选中这个 <符号 查看源代码是这样的
<html lang="en"><head></head><body>&lt;
<meta charset="UTF-8">
<title>webpack test</title>
<script type="text/javascript" src="hello.bundle.js">
</script>
</body></html>
<html lang="en"><head></head><body>&lt;
<meta charset="UTF-8">
<title>webpack test</title>
<script type="text/javascript" src="hello.bundle.js">
</script>
</body></html>
2017-10-14