forked from code16/sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.mix.js
51 lines (47 loc) · 1.86 KB
/
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
46
47
48
const mix = require('laravel-mix');
const webpack = require('webpack');
const path = require('path');
mix.js('resources/assets/js/sharp.js', 'resources/assets/dist/sharp.js')
.js('resources/assets/js/client-api.js', 'resources/assets/dist/client-api.js')
.sass('resources/assets/sass/app.scss', 'resources/assets/dist/sharp.css')
.sass('resources/assets/sass/cms.scss', 'resources/assets/dist/sharp-cms.css')
.copy('node_modules/element-ui/packages/theme-chalk/lib/fonts', 'resources/assets/dist/fonts')
.copy('node_modules/font-awesome/fonts', 'resources/assets/dist/fonts')
.copy('node_modules/leaflet/dist/images','resources/assets/dist/images')
.options({
processCssUrls: false
})
.version()
.extract()
.setPublicPath('resources/assets/dist')
.webpackConfig({
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.NormalModuleReplacementPlugin(/element-ui[\/\\]lib[\/\\]locale[\/\\]lang[\/\\]zh-CN/, 'element-ui/lib/locale/lang/en'),
// new (require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
],
// transpile vue-clip package
module: {
rules: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'node_modules/vue-clip'),
path.resolve(__dirname, 'node_modules/vue2-timepicker')
],
use: [
{
loader: 'babel-loader',
options: Config.babel()
}
]
}
]
},
resolve: {
alias: {
// resolve [email protected] polyfills (now 3.0)
'core-js/fn': 'core-js/features'
}
}
});