-
Notifications
You must be signed in to change notification settings - Fork 78
/
webpack.config.js
96 lines (93 loc) · 2.62 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const path = require('path');
const Webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const { version } = require('./package.json');
const rootDir = modulePath => path.resolve(__dirname, modulePath);
module.exports = {
entry: {
main: './scripts/main.js',
stylie: './scripts/stylie.js'
},
mode: 'production',
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
library: 'stylie',
libraryTarget: 'umd',
umdNamedDefine: true
},
devtool: 'source-map',
resolveLoader: {
alias: {
text: 'raw-loader'
}
},
resolve: {
modules: [
'node_modules'
],
symlinks: false,
alias: {
underscore: 'lodash',
lodash: rootDir('node_modules/lodash/index.js'),
jquery: rootDir('scripts/lib/custom-jquery'),
'jquery-mousewheel': rootDir('node_modules/jquery-mousewheel/jquery.mousewheel'),
'jquery-dragon': rootDir('node_modules/jquery-dragon/src/jquery.dragon'),
'jquery-cubelet': rootDir('node_modules/jquery-cubelet/dist/jquery.cubelet'),
rekapi: rootDir('node_modules/rekapi/src/main'),
shifty: rootDir('node_modules/shifty/src/index'),
keydrown: rootDir('node_modules/keydrown/dist/keydrown'),
lateralus: rootDir('node_modules/lateralus/dist/lateralus'),
'lateralus.component.tabs': rootDir('node_modules/@jeremyckahn/lateralus-components/tabs/main'),
aenima: rootDir('node_modules/aenima'),
bezierizer: rootDir('node_modules/bezierizer/dist/bezierizer')
}
},
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: [{
loader: 'file-loader'
}]
}, {
test: /\.(sass|scss|css)$/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}, {
loader: 'sass-loader',
options: {
sourceMap: true,
includePaths: [
path.resolve(__dirname, './node_modules/compass-mixins/lib')
]
}
}]
}
]
},
plugins: [
new CleanWebpackPlugin([ 'dist' ]),
new CopyWebpackPlugin([
{ from: 'index.html' },
{ from: 'manifest.json' },
{ from: 'img', to: 'img' }
]),
new Webpack.BannerPlugin(version),
new WorkboxPlugin.GenerateSW({
exclude: [/\.(?:DS_Store|xcf)$/],
})
],
devServer: {
host: '0.0.0.0',
port: 9005
}
};