-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (39 loc) · 1.13 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const path = require('path');
const CleanDistPlugin = require('./plugins/clean-dist-plugin.js');
module.exports = {
entry: './src/main.js',
output: {
path: path.join(__dirname, './dist'),
filename: 'bundle.js'
},
// resolveLoader : {
// modules : ['node_modules', path.join(__dirname, 'loaders')]
// },
module: {
rules: [
// 处理样式的 loader
{
test: /\.less$/,
use: [
path.join(__dirname, 'loaders', 'style-loader.js'),
path.join(__dirname, 'loaders', 'less-loader.js')
]
},
// 处理脚本的 loader(需要使用webpack进行打包测试)
// {
// test: /\.js$/,
// use: {
// loader: 'babel-loader',
// options: {
// presets: [
// '@babel/preset-env'
// ]
// }
// }
// }
]
},
plugins: [
new CleanDistPlugin()
]
};