mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 02:36:36 +00:00
cleanup webpack config
This commit is contained in:
@@ -45,11 +45,4 @@ var config = Object.assign({}, skeleton, {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
config.target = function renderer (compiler) {
|
|
||||||
compiler.apply(
|
|
||||||
new JsonpTemplatePlugin(config.output),
|
|
||||||
new FunctionModulePlugin(config.output)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = config
|
module.exports = config
|
||||||
|
|||||||
@@ -1,24 +1,16 @@
|
|||||||
var webpack = require('webpack')
|
const skeleton = require('./webpack-skeleton')
|
||||||
var path = require('path')
|
const webpack = require('webpack')
|
||||||
var JsonpTemplatePlugin = webpack.JsonpTemplatePlugin
|
const path = require('path')
|
||||||
var FunctionModulePlugin = require('webpack/lib/FunctionModulePlugin')
|
const JsonpTemplatePlugin = webpack.JsonpTemplatePlugin
|
||||||
var NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin')
|
const FunctionModulePlugin = require('webpack/lib/FunctionModulePlugin')
|
||||||
|
|
||||||
var opt = {
|
var config = Object.assign({}, skeleton, {
|
||||||
path: path.join(__dirname, 'compiled'),
|
|
||||||
filename: '[name].js',
|
|
||||||
sourceMapFilename: '[name].map',
|
|
||||||
libraryTarget: 'commonjs2',
|
|
||||||
publicPath: 'http://localhost:8080/assets/'
|
|
||||||
}
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
test: /\.js?$/,
|
test: /\.js?$/,
|
||||||
loader: 'babel-loader?cacheDirectory',
|
exclude: /node_modules/,
|
||||||
exclude: /node_modules/
|
loader: 'babel?cacheDirectory'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.styl?$/,
|
test: /\.styl?$/,
|
||||||
@@ -27,43 +19,21 @@ var config = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
output: {
|
||||||
|
path: path.join(__dirname, 'compiled'),
|
||||||
|
filename: '[name].js',
|
||||||
|
sourceMapFilename: '[name].map',
|
||||||
|
libraryTarget: 'commonjs2',
|
||||||
|
publicPath: 'http://localhost:8080/assets/'
|
||||||
|
},
|
||||||
debug: true,
|
debug: true,
|
||||||
devtool: 'eval-source-map',
|
devtool: 'eval-source-map'
|
||||||
entry: {
|
})
|
||||||
main: './browser/main/index.js',
|
|
||||||
finder: './browser/finder/index.js'
|
|
||||||
},
|
|
||||||
output: opt,
|
|
||||||
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'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
config.target = function renderer (compiler) {
|
config.target = function renderer (compiler) {
|
||||||
compiler.apply(
|
compiler.apply(
|
||||||
new JsonpTemplatePlugin(opt),
|
new JsonpTemplatePlugin(config.output),
|
||||||
new FunctionModulePlugin(opt)
|
new FunctionModulePlugin(config.output)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
var webpack = require('webpack')
|
|
||||||
var path = require('path')
|
|
||||||
var JsonpTemplatePlugin = webpack.JsonpTemplatePlugin
|
|
||||||
var FunctionModulePlugin = require('webpack/lib/FunctionModulePlugin')
|
|
||||||
var NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin')
|
|
||||||
|
|
||||||
var opt = {
|
|
||||||
path: path.join(__dirname, 'compiled'),
|
|
||||||
filename: '[name].js',
|
|
||||||
sourceMapFilename: '[name].map',
|
|
||||||
libraryTarget: 'commonjs2',
|
|
||||||
publicPath: 'http://localhost:8080/assets/'
|
|
||||||
}
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
entry: {
|
|
||||||
main: './browser/main/index.js',
|
|
||||||
finder: './browser/finder/index.js'
|
|
||||||
},
|
|
||||||
output: opt,
|
|
||||||
resolve: {
|
|
||||||
extensions: ['', '.js', '.jsx'],
|
|
||||||
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main'],
|
|
||||||
alias: {
|
|
||||||
'boost': path.resolve(__dirname, 'lib')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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
|
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
|
||||||
externals: [
|
|
||||||
'electron',
|
|
||||||
'socket.io-client',
|
|
||||||
'md5',
|
|
||||||
'superagent',
|
|
||||||
'superagent-promise',
|
|
||||||
'lodash',
|
|
||||||
'markdown-it',
|
|
||||||
'moment',
|
|
||||||
'highlight.js',
|
|
||||||
'markdown-it-emoji',
|
|
||||||
'fs-jetpack'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
config.target = function renderer (compiler) {
|
|
||||||
compiler.apply(
|
|
||||||
new JsonpTemplatePlugin(opt),
|
|
||||||
new FunctionModulePlugin(opt)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = config
|
|
||||||
Reference in New Issue
Block a user