-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Although I love browserify/watchify, there have been some issues with tree shaking making the bundle much bigger than it would need to be that I just decided to use webpack/babel. Recompilation under --watch now works much faster - originally I found watchify to be much faster than webpack, but I guess that was fixed.
- Loading branch information
Showing
7 changed files
with
10,492 additions
and
8,847 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,52 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
entry: './src/client/index.tsx', | ||
// devtool: 'inline-source-map', | ||
module: { | ||
rules: [{ | ||
// test: /\.tsx?$/, | ||
// use: 'ts-loader', | ||
// exclude: /node_modules/, | ||
// }, { | ||
test: /\.tsx?$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: [ | ||
[ | ||
'@babel/preset-react', | ||
], [ | ||
'@babel/preset-env', | ||
{ | ||
'forceAllTransforms': true, | ||
'targets': { | ||
'browsers': [ | ||
'last 2 versions', | ||
'safari >= 7', | ||
'ie >= 11', | ||
], | ||
}, | ||
}, | ||
], [ | ||
'@babel/preset-typescript', | ||
], | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-proposal-class-properties', | ||
], | ||
}, | ||
}, | ||
}], | ||
}, | ||
resolve: { | ||
extensions: ['.tsx', '.ts', '.js', '.mjs'], | ||
}, | ||
output: { | ||
filename: 'index.js', | ||
path: path.resolve(__dirname, 'build'), | ||
}, | ||
mode: 'development', | ||
} |
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,10 @@ | ||
const common = require('./webpack.common.js') | ||
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') | ||
|
||
module.exports = { | ||
...common, | ||
// plugins: [ | ||
// new BundleAnalyzerPlugin(), | ||
// ], | ||
mode: 'development', | ||
} |
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,6 @@ | ||
const common = require('./webpack.common.js') | ||
|
||
module.exports = { | ||
...common, | ||
mode: 'production', | ||
} |