Last active
August 7, 2023 11:08
-
-
Save laurisstepanovs/60c48355ee1c4408bd415ae62344b359 to your computer and use it in GitHub Desktop.
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
const path = require('path'); | |
const WebpackRTLPlugin = require('webpack-rtl-plugin'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const RemovePlugin = require('remove-files-webpack-plugin'); | |
// global variables | |
const distPath = `${path.resolve(__dirname)}/src/_metronic/assets/rtl`; | |
const entries = { style: './src/_metronic/assets/sass/style.scss' }; | |
module.exports = { | |
entry: entries, | |
output: { | |
// main output path in assets folder | |
path: distPath, | |
// output path based on the entries filename | |
filename: '[name].js', | |
// clean existing output folder | |
clean: true, | |
}, | |
resolve: { | |
extensions: ['.scss'], | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.scss$/, | |
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'], | |
}, | |
], | |
}, | |
plugins: [ | |
new MiniCssExtractPlugin({ | |
filename: '[name].css', | |
}), | |
new WebpackRTLPlugin(), | |
new RemovePlugin({ | |
// delete uneeded files from webpack output | |
after: { | |
root: distPath, | |
include: ['style.js', 'style.css'], | |
trash: true, | |
}, | |
}), | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment