Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
"src": "package.json",
"use": "@now/static-build",
"config": {
"distDir": "dist"
"distDir": "compiled"
}
},
{
"src": "resources/*",
"use": "@now/static"
}
],
"routes": [
{
"src": "/app/(.*).(js|icon|css)$",
"src": "/app/(.*).(js|icon|css|svg|png|gif|jpeg)$",
"dest": "/$1.$2"
},
{
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"start": "electron app/index.js",
"lint": "eslint src/* --ext .ts,.tsx",
"format": "prettier --write \"src/**/*\"",
"build": "rimraf compiled && env-cmd cross-env TS_NODE_PROJECT=\"tsconfig-webpack.json\" webpack --mode production --config webpack.production.conf.ts",
"build": "TS_NODE_PROJECT=\"tsconfig-webpack.json\" webpack --mode production",
"build:env": "rimraf compiled && env-cmd cross-env TS_NODE_PROJECT=\"tsconfig-webpack.json\" webpack --mode production",
"meta": "node scripts/meta.js",
"prepack": "rimraf dist && env-cmd npm run meta && electron-builder --dir",
"pack": "rimraf dist && env-cmd npm run meta && electron-builder",
Expand Down
17 changes: 14 additions & 3 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import HtmlWebpackPlugin from 'html-webpack-plugin'
import express from 'express'
import ErrorOverlayPlugin from 'error-overlay-webpack-plugin'
import CopyPlugin from 'copy-webpack-plugin'
import TerserPlugin from 'terser-webpack-plugin'

module.exports = (env, argv) => {
const config = {
Expand All @@ -16,12 +17,22 @@ module.exports = (env, argv) => {
filename: 'bundle.js',
// the output bundle

path: path.resolve(__dirname, 'compiled'),
publicPath: ''
path: path.resolve(__dirname, 'compiled')
},

devtool: 'inline-source-map',

optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_fnames: /Block|Value|Bool|BooleanLiteral|Null|NullLiteral|Literal|NumberLiteral|StringLiteral|RegexLiteral|Arr|Obj|Op|Parens/
}
})
]
},

module: {
rules: [
{
Expand Down Expand Up @@ -121,7 +132,7 @@ module.exports = (env, argv) => {
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server'
)
config.output.publicPath = '/app'
;(config.output as any).publicPath = '/app'
}

return config
Expand Down
92 changes: 0 additions & 92 deletions webpack.production.config.ts

This file was deleted.