Skip to content

Commit

Permalink
update gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Rokt33r committed Dec 24, 2015
1 parent a7a499a commit 1331470
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.env
node_modules/*
!node_modules/boost
dist/
compiled
/dist
/compiled
/secret
55 changes: 55 additions & 0 deletions webpack-production.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const skeleton = require('./webpack-skeleton')
const webpack = require('webpack')
const path = require('path')
const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin')

var JsonpTemplatePlugin = webpack.JsonpTemplatePlugin
var FunctionModulePlugin = require('webpack/lib/FunctionModulePlugin')
var config = Object.assign({}, skeleton, {
module: {
loaders: [
{
test: /(\.js|\.jsx)?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
},
{
test: /\.styl?$/,
exclude: /(node_modules|bower_components)/,
loader: 'style-loader!css-loader!stylus-loader'
}
]
},
output: {
path: path.join(__dirname, 'compiled'),
filename: '[name].js',
libraryTarget: 'commonjs2',
sourceMapFilename: '[name].map',
publicPath: 'http://localhost:8080/assets/'
},
plugins: [
new webpack.NoErrorsPlugin(),
new NodeTargetPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
'BABEL_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
]
})

config.target = function renderer (compiler) {
compiler.apply(
new JsonpTemplatePlugin(config.output),
new FunctionModulePlugin(config.output)
)
}

module.exports = config
37 changes: 37 additions & 0 deletions webpack-skeleton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const webpack = require('webpack')
const path = require('path')
const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin')

var config = {
entry: {
main: './browser/main/index.js',
finder: './browser/finder/index.js'
},
resolve: {
extensions: ['', '.js', '.jsx'],
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main'],
alias: {
'boost': path.resolve(__dirname, 'lib')
}
},
plugins: [
new webpack.NoErrorsPlugin(),
new NodeTargetPlugin()
],
externals: [
'electron',
'socket.io-client',
'md5',
'superagent',
'superagent-promise',
'lodash',
'markdown-it',
'moment',
'highlight.js',
'markdown-it-emoji',
'fs-jetpack'
]
}

module.exports = config

0 comments on commit 1331470

Please sign in to comment.