Created
February 7, 2022 15:40
-
-
Save wpflames/cd3cc70e3be397d865db362dfe86e1d4 to your computer and use it in GitHub Desktop.
Webpack with SASS Loader
This file contains hidden or 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'); | |
| module.exports = { | |
| mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', | |
| entry: [ | |
| __dirname + '/assets/js/app.js', | |
| __dirname + '/assets/sass/style.scss' | |
| ], | |
| output: { | |
| path: path.resolve(__dirname, 'assets'), | |
| filename: 'build/script.min.js', | |
| }, | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.js$/, | |
| exclude: /node_modules/, | |
| use: [], | |
| }, { | |
| test: /\.scss$/, | |
| exclude: /node_modules/, | |
| type: 'asset/resource', | |
| generator: { | |
| filename: 'build/style.min.css' | |
| }, | |
| use: [ | |
| 'sass-loader' | |
| ] | |
| } | |
| ] | |
| }, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment