forked from clappr/clappr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-base-config.js
62 lines (60 loc) · 1.68 KB
/
webpack-base-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
/* eslint-disable no-var */
var path = require('path')
var webpack = require('webpack')
var DirectoryNamedWebpackPlugin = require('directory-named-webpack-plugin')
module.exports = {
node: { Buffer: false, global: true, process: true, setImmediate: false },
plugins: [
new DirectoryNamedWebpackPlugin(true),
new webpack.DefinePlugin({
VERSION: JSON.stringify(require('./package.json').version),
PLAIN_HTML5_ONLY: JSON.stringify(!!process.env.CLAPPR_PLAIN_HTML5_ONLY)
})
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [path.resolve(__dirname, './node_modules')]
// config in .babelrc
},
{
test: /fonts\.css$/,
loaders: ['css-loader', 'postcss-loader'],
include: path.resolve(__dirname, 'src/components/core/public')
},
{
test: /\.scss$/,
loaders: ['style-loader?singleton=true', 'css-loader', 'postcss-loader', 'sass-loader?includePaths[]='
+ path.resolve(__dirname, './src/base/scss')
],
include: path.resolve(__dirname, 'src')
},
{
test: /\.(png|woff|eot|swf|cur|ttf)/,
loader: 'url-loader',
options: {
limit: 1,
publicPath: '<%=baseUrl%>/'
},
},
{
test: /\.svg/, loader: 'svg-inline-loader'
},
{
test: /\.html/, loader: 'html-loader?minimize=false'
}
]
},
resolve: {
alias: {
'clappr-zepto': 'clappr-zepto/zepto.js'
},
modules: ['node_modules']
},
devServer: {
disableHostCheck: true, // https://github.com/webpack/webpack-dev-server/issues/882
},
devtool: 'source-map'
}