forked from nukeop/nuclear
-
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.
Use webpack to bundle the main electron process script
- Loading branch information
Showing
5 changed files
with
86 additions
and
7 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 |
---|---|---|
|
@@ -59,4 +59,5 @@ typings/ | |
|
||
release | ||
dist | ||
nuclear.json | ||
nuclear.json | ||
bundle.electron.js |
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
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,37 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const HappyPack = require('happypack'); | ||
|
||
module.exports = { | ||
entry: './main.js', | ||
output: { | ||
path: __dirname, | ||
filename: 'bundle.electron.js' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /.jsx?$/, | ||
use: 'happypack/loader?id=jsx', | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /.node$/, | ||
use: 'node-loader' | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.NamedModulesPlugin(), | ||
new HappyPack({ | ||
id: 'jsx', | ||
loaders: [ 'babel-loader' ] | ||
}), | ||
], | ||
node: { | ||
fs: "empty", | ||
__dirname: false, | ||
__filename: false | ||
}, | ||
target: 'electron-main' | ||
}; |
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,39 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const HappyPack = require('happypack'); | ||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: './main.prod.js', | ||
output: { | ||
path: __dirname, | ||
filename: './dist/bundle.electron.js' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /.jsx?$/, | ||
use: 'happypack/loader?id=jsx', | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /.node$/, | ||
use: 'node-loader' | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.NamedModulesPlugin(), | ||
new HappyPack({ | ||
id: 'jsx', | ||
loaders: [ 'babel-loader' ] | ||
}), | ||
new UglifyJsPlugin() | ||
], | ||
node: { | ||
fs: "empty", | ||
__dirname: false, | ||
__filename: false | ||
}, | ||
target: 'electron-main' | ||
}; |
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