-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was motivated by parcel's inability to properly tree shake the Material UI library, as well as its half-baked bundle analysis solutions in v2. parcel-bundler/parcel#4565
- Loading branch information
1 parent
923acd5
commit c0f71ac
Showing
8 changed files
with
1,127 additions
and
2,817 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 |
---|---|---|
@@ -1,2 +1,9 @@ | ||
[build] | ||
functions = "./functions" | ||
publish = "dist/" | ||
command = "yarn webpack:build" | ||
functions = "./functions" | ||
[dev] | ||
framework = "#custom" | ||
command = "yarn webpack:dev" | ||
targetPort = 9000 | ||
autoLaunch = true |
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 was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const path = require('path'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | ||
|
||
module.exports = { | ||
entry: './src/index.jsx', | ||
output: { | ||
filename: 'main.js', | ||
path: path.resolve(__dirname, 'dist'), | ||
}, | ||
devServer: { | ||
contentBase: path.join(__dirname, 'dist'), | ||
compress: true, | ||
port: 9000 | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: './src/index.html', | ||
}) | ||
], | ||
module: { | ||
rules: [ | ||
{ test: /\.jsx$/, exclude: /node_modules/, loader: "babel-loader" } | ||
] | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.jsx'], | ||
alias: { | ||
"react": "preact/compat", | ||
"react-dom": "preact/compat" | ||
} | ||
} | ||
}; | ||
|
||
|
||
if (process.env.ANALYZE !== undefined) { | ||
const bundleAnalyzer = new BundleAnalyzerPlugin() | ||
module.exports.plugins.push(bundleAnalyzer); | ||
} |
Oops, something went wrong.