-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
63 lines (54 loc) · 1.49 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// MDEV Digital - Webpack Boilerplate[VueJS]
// Webpack 4 Configuration file
// -----------------------------------------
// PRODUCTION ENVIRONMENT
// ----------------------------------------
// Required Imports
const {resolve} = require('path')
const webpack = require('webpack')
const StyleLintPlugin = require('stylelint-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const autoprefixer = require('autoprefixer');
const setPath = function(folderName) {
return path.join(__dirname, folderName);
}
// Module Exports
module.exports = {
entry: './index.js',
output: {
path: resolve(__dirname, 'dist'),
filename: 'build.js'
},
// Modules
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "to-string!css-loader?minimize&-autoprefixer!postcss-loader!sass-loader"
})
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{ loader: 'css-loader?minimize&-autoprefixer!postcss-loader!sass-loader' },
{ loader: 'sass-loader'},
{ loader: 'postcss-loader'}
]
})
}
]
},
//plugins
plugins: [
new webpack.LoaderOptionsPlugin({ options: { postcss: [ autoprefixer ] } }),
new ExtractTextPlugin("/compiled/styles.css"),
new StyleLintPlugin({
syntax: 'scss',
configFile: './.stylelintrc'
})
]
}