Skip to content
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

Proposal: Let's Replace Parcel With Webpack #2641

Merged
merged 8 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Proposal: Let's Replace Parcel With Webpack
Closes #2487 and #2474

This is just a development server at this point. It hot reloads HTML JS and CSS.  That's enough for me. I'm open to contrary opinions.
  • Loading branch information
roblarsen committed Nov 17, 2021
commit 8c11efc2f05872087393c4611b83656711f1878b
13 changes: 8 additions & 5 deletions dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
"license": "",
"author": "",
"scripts": {
"build": "parcel build index.html",
"dev": "parcel index.html --open",
"start": "npm run build && npm run dev",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server --open --port 8080"
},
"dependencies": {
"webpack": "^4.36.1"
},
"devDependencies": {
"parcel-bundler": "^1.12.5"
"html-webpack-plugin": "^3.2.0",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
}
}
15 changes: 15 additions & 0 deletions dist/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry : "./js/main.js",
devServer: {
liveReload: true,
watchContentBase: true,
inline: true,
hot: true,
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html'
})
]
};
13 changes: 8 additions & 5 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
"license": "",
"author": "",
"scripts": {
"build": "parcel build index.html",
"dev": "parcel index.html --open",
"start": "npm run build && npm run dev",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server --open --port 8080"
},
"dependencies": {
"webpack": "^4.36.1"
},
"devDependencies": {
"parcel-bundler": "^1.12.5"
"html-webpack-plugin": "^3.2.0",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
}
}
15 changes: 15 additions & 0 deletions src/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry : "./js/main.js",
devServer: {
liveReload: true,
watchContentBase: true,
inline: true,
hot: true,
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html'
})
]
};
1 change: 1 addition & 0 deletions test/file_existence.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const expectedFilesInDistDir = [
'404.html',
'package.json',
'browserconfig.xml',
'webpack.config.js',

'css/', // for directories, a `/` character
// should be included at the end
Expand Down