-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
42 lines (41 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
42
// Add this to a webpack.config.js file
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: {
site: ['./assets/javascripts/site.js'],
style: ['./assets/stylesheets/site.css.scss'],
},
output: {
publicPath: '',
path: path.resolve(__dirname, '.tmp/dist'),
filename: '[name].min.js',
},
module: {
rules: [
{
test: /\.(scss|sass|css)$/i,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { sourceMap: true, importLoaders: 1 } },
{ loader: 'postcss-loader', options: { sourceMap: true } },
'resolve-url-loader',
{ loader: 'sass-loader', options: { sourceMap: true } }
]
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [{
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
}],
},
{
test: /\.(ttf|eot|svg|gif|jpg|png)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [{
loader: 'file-loader'
}]
}
]
},
plugins: [new MiniCssExtractPlugin()],
};