forked from them-es/starter-fse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js.TRASH
executable file
·72 lines (71 loc) · 1.33 KB
/
webpack.config.js.TRASH
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
64
65
66
67
68
69
70
71
72
const path = require( 'path' ),
// Modify "dev_url" to actual localhost url
dev_url = 'http://themes.localhost/starter-fse';
module.exports = {
context: path.resolve( __dirname, 'assets' ),
entry: [
'./main.scss',
'./main.js',
],
output: {
path: path.resolve( __dirname, 'assets/dist' ),
filename: '[name].bundle.js',
},
//devtool: 'source-map',
watch: true,
devServer: {
proxy: {
'*': {
target: dev_url,
changeOrigin: true,
}
}
},
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: 'file-loader',
options: {
name: 'main.css',
},
},
{ loader: 'extract-loader' },
{ loader: 'css-loader' },
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
require( 'autoprefixer' )
]
},
}
},
{
loader: 'sass-loader',
options: {
implementation: require( 'sass' ),
webpackImporter: false, // See https://github.com/webpack-contrib/sass-loader/issues/804
sassOptions: {
includePaths: [ 'node_modules' ],
},
},
}
]
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loader: 'file-loader',
options: {
esModule: false,
outputPath: '../img',
publicPath: '../img',
name: '[name].[ext]',
},
},
]
},
};