Skip to content

Commit

Permalink
upgrade to node18
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthakumaran committed Aug 7, 2023
1 parent b68f606 commit bf5628c
Show file tree
Hide file tree
Showing 8 changed files with 6,630 additions and 12,501 deletions.
19,043 changes: 6,590 additions & 12,453 deletions assets/package-lock.json

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
"@types/d3": "^7.0.0",
"@types/phoenix_live_view": "^0.15.1",
"babel-loader": "^8.0.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.4.2",
"hard-source-webpack-plugin": "^0.13.1",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.1",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"sass-loader": "^8.0.2",
"terser-webpack-plugin": "^2.3.2",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.2"
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"mini-css-extract-plugin": "^2.7.6",
"node-sass": "^8.0",
"sass-loader": "^13.3",
"terser-webpack-plugin": "^2.3.8",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
}
52 changes: 23 additions & 29 deletions assets/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,47 @@
const path = require('path');
const glob = require('glob');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require("path");
const glob = require("glob");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");

module.exports = (env, options) => {
const devMode = options.mode !== 'production';
const devMode = options.mode !== "production";

return {
optimization: {
minimizer: [
new TerserPlugin({ cache: true, parallel: true, sourceMap: devMode }),
new OptimizeCSSAssetsPlugin({})
]
new CssMinimizerPlugin(),
],
},
entry: {
'app': glob.sync('./vendor/**/*.js').concat(['./js/app.js'])
app: glob.sync("./vendor/**/*.js").concat(["./js/app.js"]),
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, '../priv/static/js'),
publicPath: '/js/'
filename: "[name].js",
path: path.resolve(__dirname, "../priv/static/js"),
publicPath: "/js/",
},
devtool: devMode ? 'eval-cheap-module-source-map' : undefined,
devtool: devMode ? "eval-cheap-module-source-map" : undefined,
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
loader: "babel-loader",
},
},
{
test: /\.[s]?css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
}
]
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
},
],
},
plugins: [
new MiniCssExtractPlugin({ filename: '../css/app.css' }),
new CopyWebpackPlugin([{ from: 'static/', to: '../' }])
]
.concat(devMode ? [new HardSourceWebpackPlugin()] : [])
}
new MiniCssExtractPlugin({ filename: "../css/app.css" }),
new CopyWebpackPlugin({ patterns: [{ from: "static/", to: "../" }] }),
],
};
};
2 changes: 1 addition & 1 deletion dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Application.put_env(:exq_ui, DemoWeb.Endpoint,
"node_modules/webpack/bin/webpack.js",
"--mode",
System.get_env("NODE_ENV") || "production",
"--watch-stdin",
"--watch-options-stdin",
cd: "assets"
]
],
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion priv/static/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion priv/static/js/app.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
nativeBuildInputs =
[ pkgs.nodejs-18_x pkgs.beam.packages.erlangR25.elixir_1_14 ];
}

0 comments on commit bf5628c

Please sign in to comment.