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
npm run build
Check dist/bundle.js, using js imported style works fine, colors.css is not duplicated`
Uncomment the @value Red-500 from './colors.css'; line in app.vue, and npm run build
Check dist/bundle.js, you'll now see colors.css duplicated.
This bug causes colors.css to be duplicated every time a component
uses @value ... from ... inside <style module> block
What is expected?
Only one colors.css
What is actually happening?
Duplicated colors.css
The text was updated successfully, but these errors were encountered:
The root cause of this is that css-loader appends the importing module's inline loader request prefixes to all imported modules. So for import 'css-loader?foo!colors.css' and import 'css-loader?bar!colors.css', any files imported by colors.css will be duplicated because technically they might need to be processed with different options.
This is unfortunately unfixable in v14. But I managed to get it resolved in v15.
Version
14.2.1
Webpack 4.1.1
Reproduction link
https://github.com/fnlctrl/vue-loader-duplicate-cssm-import-repro
Steps to reproduce
npm install
npm run build
Check dist/bundle.js, using js imported style works fine,
colors.css
is not duplicated`Uncomment the
@value Red-500 from './colors.css';
line in app.vue, andnpm run build
Check dist/bundle.js, you'll now see
colors.css
duplicated.This bug causes
colors.css
to be duplicated every time a componentuses
@value ... from ...
inside<style module>
blockWhat is expected?
Only one
colors.css
What is actually happening?
Duplicated
colors.css
The text was updated successfully, but these errors were encountered: