Skip to content

Commit

Permalink
Update Webpack 5 loader config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Jun 2, 2022
1 parent b4b23dd commit 569b1f2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [1.0.0.beta1] — 2022-06-01
## [1.1.0.beta2] — 2022-06-01

- Update Webpack 5 default config to switch to native asset loaders (no more `file-loader` needed)

## [1.1.0.beta1] — 2022-06-01

- New bundled configurations: Lit, Shoelace, Ruby2JS, Open Props [#553](https://github.com/bridgetownrb/bridgetown/pull/553) ([jaredcwhite](https://github.com/jaredcwhite))
- NOTE: "frontend component files" (aka `.js`/`.css` files within the `src/_components` folder) will now be ignored by the build process watcher, thus allowing the frontend bundling refresh to trigger a dev reload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
return if Bridgetown.environment.test?

required_packages = %w(esbuild esbuild-loader css-loader@6.7.1 webpack@5.72.0 webpack-cli@4.9.2 webpack-manifest-plugin@5.0.0)
redundant_packages = %w(@babel/core @babel/plugin-proposal-class-properties @babel/plugin-proposal-decorators @babel/plugin-transform-runtime @babel/preset-env babel-loader)
redundant_packages = %w(@babel/core @babel/plugin-proposal-class-properties @babel/plugin-proposal-decorators @babel/plugin-transform-runtime @babel/preset-env babel-loader file-loader)

say "Installing required packages"
run "yarn add -D --tilde #{required_packages.join(" ")}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,18 @@ const cssRules = {

const fontsRule = {
test: /\.woff2?$|\.ttf$|\.eot$/,
loader: "file-loader",
options: {
name: "[name]-[contenthash].[ext]",
outputPath: "../fonts",
publicPath: "../fonts",
},
type: "asset/resource",
generator: {
filename: "../fonts/[name]-[hash][ext][query]"
}
}

const imagesRule = {
test: /\.png?$|\.gif$|\.jpg$|\.svg$/,
loader: "file-loader",
options: {
name: "[path][name]-[contenthash].[ext]",
outputPath: "../",
publicPath: "../",
},
type: "asset/resource",
generator: {
filename: "../[path][name]-[hash][ext][query]"
}
}

// Default configuration object
Expand Down
2 changes: 1 addition & 1 deletion bridgetown-core/lib/bridgetown-core/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module Bridgetown
VERSION = "1.1.0.beta1"
VERSION = "1.1.0.beta2"
CODE_NAME = "Belmont"
end
1 change: 0 additions & 1 deletion bridgetown-core/lib/site_template/package.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"esbuild": "^0.14.39",
<%- if frontend_bundling_option == "webpack" -%>
"esbuild-loader": "^2.18.0",
"file-loader": "^6.2.0",
"mini-css-extract-plugin": "^2.6.0",
<%- else -%>
"glob": "^8.0.1",
Expand Down

0 comments on commit 569b1f2

Please sign in to comment.