Improve prod build. Add screenshot to readme.
This commit is contained in:
parent
df9ba6d5ea
commit
f663e23bc9
@ -1,6 +1,9 @@
|
||||
# Transport
|
||||
|
||||
A generative art project in progress.
|
||||
Work-in-progress procedurally generated train network simulation written in
|
||||
Typescript with PixiJs.
|
||||
|
||||

|
||||
|
||||
## Development
|
||||
|
||||
|
BIN
img/screenshot.png
Normal file
BIN
img/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 307 KiB |
@ -38,6 +38,7 @@
|
||||
"tslint": "^5.9.1",
|
||||
"tslint-config-airbnb": "^5.8.0",
|
||||
"typescript": "^2.8.1",
|
||||
"uglifyjs-webpack-plugin": "^1.2.4",
|
||||
"webpack": "^4.4.1",
|
||||
"webpack-cli": "^2.0.13",
|
||||
"webpack-dev-server": "^3.1.1"
|
||||
|
@ -1,13 +1,20 @@
|
||||
const path = require('path');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
|
||||
const prodPlugins = env === 'production' ? [
|
||||
new UglifyJsPlugin({
|
||||
sourceMap: true,
|
||||
}),
|
||||
] : [];
|
||||
|
||||
module.exports = {
|
||||
entry: './src/transport.ts',
|
||||
output: {
|
||||
filename: 'transport.js',
|
||||
filename: env === 'production' ? '[name].min.js' : '[name].js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
mode: env === 'production' ? 'production' : 'development',
|
||||
@ -61,8 +68,20 @@ module.exports = {
|
||||
disable: env === 'development',
|
||||
filename: '[name].css',
|
||||
}),
|
||||
...prodPlugins,
|
||||
],
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
commons: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendors',
|
||||
chunks: 'all',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
devtool: env === 'production' ? 'source-map' : 'cheap-module-eval-source-map',
|
||||
devServer: {
|
||||
contentBase: path.join(__dirname, 'dist'),
|
||||
host: '0.0.0.0',
|
||||
|
Loading…
Reference in New Issue
Block a user