fix(build): prevent all styles from being purged

Signed-off-by: SphericalKat <amolele@gmail.com>
This commit is contained in:
Amogh Lele 2021-08-14 15:18:55 +05:30
parent 0091de08b0
commit 40b55e47de
No known key found for this signature in database
GPG Key ID: ED5C54FBBB920E51
4 changed files with 7 additions and 4 deletions

View File

@ -24,11 +24,10 @@ RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
COPY priv priv COPY priv priv
COPY assets assets COPY assets assets
COPY lib lib
RUN npm run --prefix ./assets deploy RUN npm run --prefix ./assets deploy
RUN mix phx.digest RUN mix phx.digest
# compile and build release
COPY lib lib
# uncomment COPY if rel/ exists # uncomment COPY if rel/ exists
# COPY rel rel # COPY rel rel
RUN mix do compile, release RUN mix do compile, release

View File

@ -3,7 +3,7 @@
"description": " ", "description": " ",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"deploy": "webpack --mode production", "deploy": "NODE_ENV=production webpack --mode production",
"watch": "webpack --mode development --watch" "watch": "webpack --mode development --watch"
}, },
"dependencies": { "dependencies": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -9,6 +9,10 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = (env, options) => { module.exports = (env, options) => {
const devMode = options.mode !== 'production'; const devMode = options.mode !== 'production';
const PATHS = {
src: path.join(__dirname, '../')
}
return { return {
optimization: { optimization: {
minimizer: [ minimizer: [
@ -47,7 +51,7 @@ module.exports = (env, options) => {
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({ filename: '../css/app.css' }), new MiniCssExtractPlugin({ filename: '../css/app.css' }),
new CopyWebpackPlugin([{ from: 'static/', to: '../' }]) new CopyWebpackPlugin([{ from: 'static/', to: '../' }]),
] ]
.concat(devMode ? [new HardSourceWebpackPlugin()] : []) .concat(devMode ? [new HardSourceWebpackPlugin()] : [])
} }