-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
webpack.config.js
68 lines (67 loc) · 1.93 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
var webpack = require('webpack');
var path = require('path');
var autoprefixer = require('autoprefixer');
var UnminifiedWebpackPlugin = require('unminified-webpack-plugin');
module.exports = {
watch: true,
context: __dirname + "/",
entry: [
__dirname + '/app/js/app.babel.jsx'
],
module: {
preLoaders: [
{
exclude: /src\//,
loader: 'source-map'
}
],
loaders: [
{ test: /\.(json)$/, exclude: /node_modules/, loaders: ['json-loader'] },
{ test: /\.(jsx|.js|babel.jsx|babel.js)$/,
exclude: /node_modules/,
loader: 'babel-loader!eslint'
},
{ 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 {
defaults: [ require('precss'), require('postcss-cssnext'),
require('postcss-modules'), require('postcss-automath'),
require('postcss-mixins')
],
cleaner: [autoprefixer({ browsers: ['last 2 versions'] })]
};
},
output: {
path: __dirname + '/app/build/',
filename: 'mojs-timeline-editor.js',
publicPath: 'build/',
library: 'mojs-timeline-editor',
libraryTarget: 'umd',
umdNamedDefine: true,
},
plugins: [
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false
// }
// }),
// new UnminifiedWebpackPlugin()
],
// devtool: process.env.NODE_ENV === 'production' ? 'source-map' : 'inline-source-map',
resolve: {
root: [ path.resolve('./') ],
moduleDirectories: ['node_modules'],
target: 'node',
extensions: [
'', '.js', '.babel.js', '.babel.jsx',
'.postcss.css', '.css', '.json'
]
}
};