You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
Hi!
I am trying to make webpack produce the scss typings, together with a main.css file in the output dir that holds the same classes as the generated scss module (I've inspected the main.js and there is css created there, but since I am not injecting it on an index file automatically I am clueless on how to use it).
So, using webpack --mode development produces the correct main.css file, but it breaks my JS. Using webpack --mode production produces functional JS code with proper typings next to each css file, but no main.css. So I am doing 2 passes, one in development and copying the main.css to a distribution folder, and another production pass and copying the main.js to that distribution folder as well.
This is very hacky to say the least. Also tried to check if there are ways to process each file type with multiple loaders but not chained, or if there were any pluings for pre compilation hooks to produce that main.css file, but haven't found anything that will let me develop with ease and reload upon changes on my stylings, so I am asking you guys for help with webpack 4 configurations for this loader module.
Code:
const prodSCSS = 'typings-for-css-modules-loader?modules&sass&banner=// This file is automatically generated by typings-for-css-modules.\n// Please do not change this file\n\n';
const devSCSS = ExtractTextPlugin.extract('typings-for-css-modules-loader?modules');
...
{
test: /\.scss$/,
include: path.join(__dirname, 'src'),
loader: argv.mode === 'production' ? prodSCSS : devSCSS
}
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi!
I am trying to make webpack produce the scss typings, together with a main.css file in the output dir that holds the same classes as the generated scss module (I've inspected the main.js and there is css created there, but since I am not injecting it on an index file automatically I am clueless on how to use it).
So, using
webpack --mode development
produces the correctmain.css
file, but it breaks my JS. Usingwebpack --mode production
produces functional JS code with proper typings next to each css file, but nomain.css
. So I am doing 2 passes, one in development and copying the main.css to a distribution folder, and another production pass and copying the main.js to that distribution folder as well.This is very hacky to say the least. Also tried to check if there are ways to process each file type with multiple loaders but not chained, or if there were any pluings for pre compilation hooks to produce that main.css file, but haven't found anything that will let me develop with ease and reload upon changes on my stylings, so I am asking you guys for help with webpack 4 configurations for this loader module.
Code:
Thanks in advance!
The text was updated successfully, but these errors were encountered: