forked from Automattic/simplenote-electron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.27 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
const autoprefixer = require( 'autoprefixer' );
const webpack = require( 'webpack' );
const AppCachePlugin = require( 'appcache-webpack-plugin' );
const HtmlWebpackPlugin = require( 'html-webpack-plugin' );
module.exports = {
context: __dirname + '/lib',
devtool: 'sourcemap',
entry: [
'./boot'
],
output: {
path: __dirname + '/dist',
filename: 'app.js'
},
module: {
preLoaders: [
{ test: /\.jsx?$/, exclude: /node_modules|lib\/simperium/, loaders: [ 'eslint-loader' ] }
],
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: [ 'babel' ] },
{ test: /\.json$/, loader: 'json-loader'},
{ test: /\.scss$/, loader: 'style-loader!css-loader!postcss-loader!sass-loader'}
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.json', '.scss', '.css' ],
moduleDirectories: [ 'lib', 'node_modules' ]
},
plugins: [
new webpack.DllReferencePlugin( {
context: process.cwd(),
manifest: require( process.cwd() + '/dist/vendor.json' )
} ),
new AppCachePlugin(),
new HtmlWebpackPlugin( {
title: 'Simplenote',
templateContent: require( './index-builder.js' ),
inject: false
} ),
new webpack.DefinePlugin( {
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'development'
)
} )
],
postcss: [ autoprefixer() ]
};