Skip to content

Commit 1331470

Browse files
committed
update gitignore
1 parent a7a499a commit 1331470

3 files changed

Lines changed: 94 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.env
22
node_modules/*
33
!node_modules/boost
4-
dist/
5-
compiled
4+
/dist
5+
/compiled
66
/secret

webpack-production.config.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
const skeleton = require('./webpack-skeleton')
2+
const webpack = require('webpack')
3+
const path = require('path')
4+
const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin')
5+
6+
var JsonpTemplatePlugin = webpack.JsonpTemplatePlugin
7+
var FunctionModulePlugin = require('webpack/lib/FunctionModulePlugin')
8+
var config = Object.assign({}, skeleton, {
9+
module: {
10+
loaders: [
11+
{
12+
test: /(\.js|\.jsx)?$/,
13+
exclude: /(node_modules|bower_components)/,
14+
loader: 'babel'
15+
},
16+
{
17+
test: /\.styl?$/,
18+
exclude: /(node_modules|bower_components)/,
19+
loader: 'style-loader!css-loader!stylus-loader'
20+
}
21+
]
22+
},
23+
output: {
24+
path: path.join(__dirname, 'compiled'),
25+
filename: '[name].js',
26+
libraryTarget: 'commonjs2',
27+
sourceMapFilename: '[name].map',
28+
publicPath: 'http://localhost:8080/assets/'
29+
},
30+
plugins: [
31+
new webpack.NoErrorsPlugin(),
32+
new NodeTargetPlugin(),
33+
new webpack.optimize.OccurenceOrderPlugin(),
34+
new webpack.DefinePlugin({
35+
'process.env': {
36+
'NODE_ENV': JSON.stringify('production'),
37+
'BABEL_ENV': JSON.stringify('production')
38+
}
39+
}),
40+
new webpack.optimize.UglifyJsPlugin({
41+
compressor: {
42+
warnings: false
43+
}
44+
})
45+
]
46+
})
47+
48+
config.target = function renderer (compiler) {
49+
compiler.apply(
50+
new JsonpTemplatePlugin(config.output),
51+
new FunctionModulePlugin(config.output)
52+
)
53+
}
54+
55+
module.exports = config

webpack-skeleton.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const webpack = require('webpack')
2+
const path = require('path')
3+
const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin')
4+
5+
var config = {
6+
entry: {
7+
main: './browser/main/index.js',
8+
finder: './browser/finder/index.js'
9+
},
10+
resolve: {
11+
extensions: ['', '.js', '.jsx'],
12+
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main'],
13+
alias: {
14+
'boost': path.resolve(__dirname, 'lib')
15+
}
16+
},
17+
plugins: [
18+
new webpack.NoErrorsPlugin(),
19+
new NodeTargetPlugin()
20+
],
21+
externals: [
22+
'electron',
23+
'socket.io-client',
24+
'md5',
25+
'superagent',
26+
'superagent-promise',
27+
'lodash',
28+
'markdown-it',
29+
'moment',
30+
'highlight.js',
31+
'markdown-it-emoji',
32+
'fs-jetpack'
33+
]
34+
}
35+
36+
module.exports = config
37+

0 commit comments

Comments
 (0)