forked from Ayctor/wp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
45 lines (37 loc) · 960 Bytes
/
webpack.mix.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
let mix = require('laravel-mix');
let StyleLintPlugin = require('stylelint-webpack-plugin');
mix.setPublicPath('build/');
mix.setResourceRoot('ressources/');
mix.webpackConfig({
devServer: {
overlay: true,
},
module: {
rules: [
{
test: /.(js)$/,
loader: 'eslint-loader',
enforce: 'pre',
exclude: /node_modules/
}
]
},
plugins: [
new StyleLintPlugin({
context: 'ressources/styles',
lintDirtyModulesOnly: true,
syntax: 'scss'
}),
],
});
mix.options({
processCssUrls: false
});
mix.js('ressources/scripts/app.js', 'build/scripts/');
mix.sass('ressources/styles/app.scss', 'build/styles/');
mix.sourceMaps(true, 'cheap-source-map');
mix.version();
mix.browserSync({
proxy: 'https://wordpress.dev',
files: ['**/*.php', '!vendor/**/*.php', 'build/**/*']
});