-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
36 lines (34 loc) · 1019 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
const mix = require('laravel-mix')
const pkg = require('./package.json')
const { join } = require('path')
const path = {
resources: join(__dirname, 'src'),
assets: join(__dirname, 'src', 'assets'),
theme: join(__dirname, 'src', 'wordpress', 'wp-content', 'themes', pkg.name)
}
mix.setPublicPath('./')
.js([ join(path.assets, 'scripts/app.js') ], join(path.theme, 'assets', 'scripts/bundle.js'))
.extract(['vue', 'jquery', 'bootstrap'])
.sass(join(path.assets, 'sass/app.scss'), join(path.theme, 'assets', 'stylesheets/bundle.css'))
.options({
extractVueStyles: true,
processCssUrls: true,
uglify: {},
purifyCss: false,
postCss: [require('autoprefixer')],
clearConsole: false
})
.sourceMaps()
.disableNotifications()
.autoload({
'jquery': ['$', 'window.jQuery', 'jQuery'],
'vue': ['Vue', 'window.Vue']
})
.webpackConfig({
resolve: {
alias: {
'~': join(__dirname, 'node_modules'),
'@': join(path.assets, 'scripts'),
}
}
})