-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·57 lines (56 loc) · 1.44 KB
/
webpack.config.js
File metadata and controls
executable file
·57 lines (56 loc) · 1.44 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const Webpack = require('webpack')
const path = require('path')
module.exports = {
entry: './app/main.js',
resolve: {
alias: {
comp: path.resolve(__dirname, 'app/components/'),
images: path.resolve(__dirname, 'app/images/'),
js: path.resolve(__dirname, 'app/js/'),
styles: path.resolve(__dirname, 'app/styles/'),
},
extensions: ['.js', '.vue']
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader' },
{ test: /\.vue$/, use: 'vue-loader' },
{ test: /\.css$/, use: ['vue-style-loader', 'css-loader']},
{ test: /\.sass$/,
use: [
'vue-style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
indentedSyntax: true,
data: `@import colors`
}
}
]
},
{ test: /\.(png|jp(e*)g|svg)$/,
use: [{
loader: 'url-loader',
options: {
limit: 8000, // Convert images < 8kb to base64 strings
name: 'images/[hash]-[name].[ext]'
}
}]
}
]
},
devServer: {
open: true,
hot: true,
},
plugins: [
new HtmlWebpackPlugin({
template: './app/index.html',
}),
new VueLoaderPlugin(),
new Webpack.HotModuleReplacementPlugin(),
]
}