-
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
colintrinity
committed
Mar 12, 2018
1 parent
70a5f42
commit f948416
Showing
5 changed files
with
113 additions
and
14 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
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
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,76 @@ | ||
let path = require('path'); | ||
let webpack = require('webpack'); | ||
const CopyWebpackPlugin = require('copy-webpack-plugin'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
let definePlugin = new webpack.DefinePlugin({ | ||
__DEV__: JSON.stringify(JSON.parse(process.env.BUILD_DEV || 'true')) | ||
}); | ||
|
||
module.exports = { | ||
entry: { | ||
app: [ | ||
path.resolve(__dirname, 'src/main') | ||
], | ||
vendor: ['gl-matrix'] | ||
}, | ||
output: { | ||
pathinfo: true, | ||
path: path.resolve(__dirname, 'build/release/'), | ||
filename: 'js/[name].js' | ||
}, | ||
plugins: [ | ||
definePlugin, | ||
new CopyWebpackPlugin([ | ||
{ context: 'resources/', from: '**/*', to: 'release' }, | ||
]), | ||
new HtmlWebpackPlugin({ | ||
template: './index.html', | ||
inject: true, | ||
filename: 'index.html' | ||
}), | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
name: "vendor", | ||
minChunks: Infinity | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
output: { | ||
comments(node, comment) { | ||
let text = comment.value; | ||
let type = comment.type; | ||
if (type === "comment2") { | ||
// multiline comment | ||
return /@copyright/i.test(text); | ||
} | ||
} | ||
} | ||
}), | ||
new webpack.optimize.AggressiveMergingPlugin() | ||
], | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
"presets": [["es2015", { modules: false }]], | ||
} | ||
}, | ||
exclude: /node_modules\/lodash/ | ||
}, | ||
{ test: /\.(glsl|frag|vert)$/, loader: 'raw-loader', include: [ path.join(__dirname, 'src') ], exclude: /node_modules/ }, | ||
{ test: /\.(glsl|frag|vert)$/, loader: 'glslify-loader', include: [ path.join(__dirname, 'src') ], exclude: /node_modules/ }, | ||
{ test: /\.worker\.js$/, loader: "worker!babel?presets[]=es2015", include: [ path.join(__dirname, 'src') ], exclude: /node_modules/ } | ||
] | ||
}, | ||
node: { | ||
fs: 'empty', | ||
net: 'empty', | ||
tls: 'empty' | ||
}, | ||
resolve: { | ||
// alias: { | ||
// 'pixi': pixi | ||
// } | ||
} | ||
}; |