forked from trazyn/weweChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
146,906 additions
and
1,231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ project.xcworkspace | |
# Android/IntelliJ | ||
# | ||
build/ | ||
release/ | ||
.idea | ||
.gradle | ||
local.properties | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
import webpack from 'webpack'; | ||
import config from './index'; | ||
import baseConfig from './webpack.config.base'; | ||
|
||
export default { | ||
|
||
...baseConfig, | ||
|
||
devtool: 'source-map', | ||
|
||
entry: [ | ||
'babel-polyfill', | ||
`./main.js`, | ||
], | ||
|
||
output: { | ||
path: config.dist, | ||
filename: 'main.js' | ||
}, | ||
|
||
plugins: [ | ||
// Minify the output | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compressor: { | ||
warnings: false | ||
} | ||
}), | ||
|
||
// NODE_ENV should be production so that modules do not perform certain development checks | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('production') | ||
}), | ||
], | ||
|
||
// https://github.com/chentsulin/webpack-target-electron-renderer#how-this-module-works | ||
target: 'electron-main', | ||
|
||
/** | ||
* Disables webpack processing of __dirname and __filename. | ||
* If you run the bundle in node.js it falls back to these values of node.js. | ||
* https://github.com/webpack/webpack/issues/2010 | ||
*/ | ||
node: { | ||
__dirname: false, | ||
__filename: false | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
import path from 'path'; | ||
import webpack from 'webpack'; | ||
import config from './index'; | ||
import HtmlWebpackPlugin from 'html-webpack-plugin'; | ||
import CopyWebpackPlugin from 'copy-webpack-plugin'; | ||
import baseConfig from './webpack.config.base'; | ||
|
||
export default { | ||
|
||
...baseConfig, | ||
|
||
devtool: 'cheap-module-source-map', | ||
|
||
entry: [ | ||
'babel-polyfill', | ||
`${config.client}/app.js`, | ||
], | ||
|
||
output: { | ||
path: config.dist, | ||
filename: 'app.[hash].js' | ||
}, | ||
|
||
plugins: [ | ||
// https://webpack.github.io/docs/list-of-plugins.html#occurrenceorderplugin | ||
// https://github.com/webpack/webpack/issues/864 | ||
new webpack.optimize.OccurrenceOrderPlugin(), | ||
|
||
// NODE_ENV should be production so that modules do not perform certain development checks | ||
new webpack.DefinePlugin({ | ||
DEBUG: false, | ||
'process.env.NODE_ENV': JSON.stringify('production') | ||
}), | ||
|
||
new CopyWebpackPlugin([ | ||
{ | ||
from: `${config.assets}/fonts/**/*`, | ||
to: `${config.dist}/src`, | ||
}, | ||
{ | ||
from: `${config.assets}/images/**/*`, | ||
to: config.dist, | ||
}, | ||
{ | ||
from: path.resolve(__dirname, '../package.json'), | ||
to: config.dist, | ||
}, | ||
]), | ||
|
||
new HtmlWebpackPlugin({ | ||
filename: `${config.dist}/src/index.html`, | ||
template: './src/index.html', | ||
inject: 'body', | ||
hash: true, | ||
minify: { | ||
collapseWhitespace: true | ||
} | ||
}) | ||
], | ||
|
||
// https://github.com/chentsulin/webpack-target-electron-renderer#how-this-module-works | ||
target: 'electron-renderer' | ||
}; |
Oops, something went wrong.