Skip to content

Commit

Permalink
clean npm packages and add babel transpilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Dussart committed Apr 17, 2024
1 parent 74e6237 commit 42cb5a7
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 282 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
},
overrides: [
{
files: ["config/webpack/**/*.js", "babel.config.js", "postcss.config.js"],
files: ["config/webpack/**/*.js", "babel.config.js"],
env: {
node: true,
},
Expand Down
13 changes: 11 additions & 2 deletions config/webpack/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,23 @@ const sharedWebpackConfig = (mode) => {
'gouvfr-nomodule': "./app/front/packs/gouvfr-nomodule.js",
'gouvfr-module': "./app/front/packs/gouvfr-module.js",
},
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: ['babel-loader'],
}
]
},
// optimization: // optimization rules
resolveLoader: {
modules: [ 'node_modules' ],
},
output: {
filename: "[name].js",
chunkFilename: "[name]-[contenthash].digested.js",
sourceMapFilename: "[file]-[fullhash].map",
chunkFilename: "[name].digested.js",
sourceMapFilename: "[file].map",
path: path.resolve(__dirname, '..', '..', 'app/assets/builds'),
hashFunction: "sha256",
hashDigestLength: 64,
Expand Down
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,10 @@
"@hotwired/turbo-rails": "^7.2.4",
"@rails/ujs": "^6.0.3-4",
"accessible-autocomplete": "^2.0.3",
"autoprefixer": "^10.4.17",
"css-loader": "^6.10.0",
"expose-loader": "^1.0.1",
"glob-parent": "^5.1.2",
"jquery": "^3.5.1",
"normalize-url": "^4.5.1",
"postcss": "^8.4.34",
"remixicon": "^4.2.0",
"sass": "^1.70.0",
"sass-loader": "^14.1.0",
"slim-select": "^2.8.1",
"stimulus": "^2.0.0",
"trim-newlines": "^3.0.1",
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4",
"whatwg-fetch": "^3.5.0"
},
"devDependencies": {
Expand All @@ -33,10 +22,18 @@
"@babel/plugin-transform-regenerator": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"babel-loader": "^9.1.3",
"babel-plugin-macros": "^3.1.0",
"eslint": "^7.14.0",
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^3.11.0"
},
"babel": {
"presets": [
"@babel/preset-env"
]
},
"scripts": {
"lint:js": "eslint ./app/front/javascripts ./app/assets/javascripts ./config/webpack",
"dev": "webpack serve --config ./config/webpack/webpack.config.js --mode development --progress",
Expand Down
Loading

0 comments on commit 42cb5a7

Please sign in to comment.