-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove parcel #993
Merged
Merged
Remove parcel #993
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
be97848
remove parcel from repo
wirednkod ba608e3
remove non-necessery webpack plugin
wirednkod d821665
fix yarn.lock conflicts
wirednkod 4e5f2bb
Fix lint complainer
wirednkod b7824c8
remove every single parcel reference
wirednkod ec2e2ed
Merge branch 'main' into nik-get-rid-of-parcel
wirednkod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
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,78 @@ | ||
/* eslint-disable no-undef */ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const webpack = require("webpack") | ||
const CopyPlugin = require("copy-webpack-plugin") | ||
const HtmlWebpackPlugin = require("html-webpack-plugin") | ||
|
||
module.exports = { | ||
mode: "production", | ||
entry: "./src/index.tsx", | ||
devtool: "inline-source-map", | ||
devServer: { | ||
port: 1234, | ||
open: true, | ||
hot: true, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
presets: ["@babel/preset-env", "@babel/preset-react"], | ||
}, | ||
}, | ||
}, | ||
{ test: /\.tsx?$/, loader: "ts-loader" }, | ||
{ | ||
test: /\.css$/i, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
{ | ||
test: /\.png$/, | ||
use: [ | ||
{ | ||
loader: "url-loader", | ||
options: { | ||
mimetype: "image/png", | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
alias: { | ||
"react/jsx-runtime": require.resolve("react/jsx-runtime"), | ||
}, | ||
extensions: ["*", ".js", ".jsx", ".ts", ".tsx"], | ||
fallback: { | ||
crypto: require.resolve("crypto-browserify"), | ||
stream: require.resolve("stream-browserify"), | ||
}, | ||
}, | ||
plugins: [ | ||
new CopyPlugin({ | ||
patterns: [{ from: "public/assets", to: "." }], | ||
}), | ||
new webpack.DefinePlugin({ | ||
process: { | ||
env: { | ||
WS_URL: JSON.stringify(undefined), | ||
}, | ||
}, | ||
}), | ||
new HtmlWebpackPlugin({ | ||
template: "./public/index.html", | ||
}), | ||
new webpack.ProvidePlugin({ | ||
Buffer: ["buffer", "Buffer"], | ||
}), | ||
new webpack.HotModuleReplacementPlugin(), | ||
], | ||
optimization: { | ||
minimize: true, | ||
}, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be preferable to move common webpack configuration into a file in the root and then merge it with the specifics for each project instead of copy/pasting it around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. This can be done in different PR though. The purpose of this pr is to remove parrcel, and not create common configs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍 but let's do this quickly after this merges
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But why?
There's nothing wrong with configuring multiple projects differently, and if projects can in theory have different configurations, then their configuration files should be separate.
It's not because files are similar that you should de-duplicate them. You should only de-duplicate them if it makes sense for the multiple different projects to always conform to the same configuration, which isn't the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the case. The vast majority of the webpack configuration is identical across landing page, burnr and the demo. It's true that they can in theory be different but in practice they're not. It's not easy at the moment to see what's specific about the configuration for each project and if you make changes to the webpack configuration you have to remember to do it in all the places for them to stay consistent. The configuration for:
is always going to be the same across these projects. If we change them we're going to want to change it everywhere. Having it one place makes that less laborious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO webpack configurations should be dedicated per projects. Finding common parts of the existing configurations and making a common one, which then will be inherited to the rest ones, and then will add the extra configs - makes it more spaghetti than simple.
Common parts of webpack configs are very little and in some cases even these are different. A good example is the
ts-loader
where indemo
we use it without extra options while inburnr
we add options liketranspileOnly
andprojectReferences
. I would say that its better to narrow down the webpack confg per project and remove unnecessary parameters that probably exists due to copy/pasting and if there is some obvious added value then to create a common webpack file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you merge all webpack configurations into one, then if you make changes to the webpack configuration you have to make sure that all projects still work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not advocating merging it all into one .. just pulling the common boilerplate out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an issue