-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
webpack.config.js
51 lines (50 loc) · 1.42 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
var path = require('path');
var webpack = require('webpack');
module.exports = {
watch: true,
context: __dirname + "/",
entry: [
__dirname + '/js/mojs-player.babel.js'
],
module: {
loaders: [
{ test: /\.(json)$/, exclude: /node_modules/, loaders: ['json-loader'] },
{ test: /\.(jsx|es6.js|babel.js|.js)$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: [ 'es2015-loose', 'babel-preset-stage-2' ],
plugins: [ 'transform-runtime' ]
}
},
{ test: /\.jade$/, loaders: ['jade'] },
{ test: /\.(postcss.css)$/, loader: "style-loader!css-loader!postcss-loader" },
{ test: /\.html$/, loader: 'raw-loader' },
{
test: /\.(eot|woff|ttf|svg|png|jpg|wav|mp3)$/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]',
}
]
},
postcss: function () {
return [ require('precss'), require('postcss-cssnext'), require('postcss-modules') ];
},
output: {
path: __dirname + '/build',
filename: 'mojs-player.js',
publicPath: 'build/',
library: 'mojs-player',
libraryTarget: 'umd',
umdNamedDefine: true
},
plugins: [],
resolve: {
root: [ path.resolve('./') ],
moduleDirectories: ['node_modules'],
target: 'node',
extensions: [
'', '.js', '.es6', '.babel.js', '.coffee',
'.postcss.css', '.css', '.json'
]
}
};