Skip to content

Commit

Permalink
fix: Update Webpacker configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois committed Nov 7, 2024
1 parent 6868e5f commit 4b1c8b1
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ git-status.txt
yarn-debug.log*
.yarn-integrity
app/compiled_views/
public/sw.js*
12 changes: 6 additions & 6 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"presets": [
[
"@babel/preset-env", {
"forceAllTransforms": true,
"useBuiltIns": "entry",
"corejs": 3,
"modules": false
}
"forceAllTransforms": true,
"useBuiltIns": "entry",
"corejs": 3,
"modules": false
}
],
["@babel/preset-react"]
],
Expand All @@ -22,4 +22,4 @@
],
["@babel/plugin-transform-regenerator", { "async": false }]
]
}
}
18 changes: 15 additions & 3 deletions config/webpack/custom.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable */

const path = require("path");
const { config } = require("@rails/webpacker");
const { InjectManifest } = require("workbox-webpack-plugin");

module.exports = {
module: {
Expand Down Expand Up @@ -93,5 +92,18 @@ module.exports = {
optimization: {
runtimeChunk: false
},
entry: config.entrypoints
entry: config.entrypoints,
plugins: [
new InjectManifest({
swSrc: "src/decidim/sw/sw.js",

/**
* NOTE:
* @rails/webpacker outputs to '/packs',
* in order to make the SW run properly
* they must be put at the project's root folder '/'
*/
swDest: "../sw.js"
})
]
}
2 changes: 1 addition & 1 deletion config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ development:
hmr: false
client:
# Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
overlay: true
overlay: false
# May also be a string
# webSocketURL:
# hostname: "0.0.0.0"
Expand Down
67 changes: 34 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "app",
"private": true,
"dependencies": {
"@decidim/browserslist-config": "^0.27.8",
"@decidim/core": "^0.27.8",
"@decidim/elections": "^0.27.8",
"@decidim/webpacker": "^0.27.8",
"@decidim/browserslist-config": "^0.27.9",
"@decidim/core": "^0.27.9",
"@decidim/elections": "^0.27.9",
"@decidim/webpacker": "^0.27.9",
"@rails/webpacker": "^6.0.0-rc.6",
"codemirror": "^5.65.17",
"confetti-js": "^0.0.18",
Expand All @@ -16,11 +16,11 @@
"highlight.js": "^11.10.0",
"inline-attachment": "^2.0.3",
"inscrybmde": "^1.11.6",
"jquery": "^3.6.3",
"jquery": "^3.7.1",
"jquery-ui": "^1.14.0",
"jquery-validation": "^1.19.5",
"jsrender": "^1.0.15",
"leaflet": "^1.3.4",
"leaflet": "^1.9.4",
"leaflet-svgicon": "^0.0.2",
"leaflet.featuregroup.subgroup": "^1.0.2",
"leaflet.markercluster": "^1.5.3",
Expand All @@ -29,6 +29,7 @@
"postcss-import": "^15.1.0",
"postcss-loader": "^7.3.0",
"postcss-preset-env": "^9.1.3",
"proj4": "^2.14.0",
"proj4leaflet": "^1.0.2",
"select2": "^4.1.0-rc.0"
},
Expand All @@ -40,9 +41,9 @@
"webpack": "5.82.0"
},
"devDependencies": {
"@decidim/dev": "^0.27.8",
"@decidim/eslint-config": "^0.27.8",
"@decidim/stylelint-config": "^0.27.8",
"@decidim/dev": "^0.27.9",
"@decidim/eslint-config": "^0.27.9",
"@decidim/stylelint-config": "^0.27.9",
"@webpack-cli/serve": "^1.7.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
Loading

0 comments on commit 4b1c8b1

Please sign in to comment.