-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b68f606
commit bf5628c
Showing
8 changed files
with
6,630 additions
and
12,501 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "../" }] }), | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ]; | ||
} |