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
This happens inside the _add function in the @modular-css/processor package. I'm not sure why the values are included, but I deleted these lines in my local setup and couldn't find any issues. Is it possible to remove them from the export in general? Or maybe, if this is actually needed by other packages, could this be set as config option so that the rollup plugin could disable it?
Steps to Reproduce (for bugs)
setup rollup with @modular-css/rollup
create a CSS file with @values
create another CSS file that imports these values
import the second CSS file in your script using the default export
invoke rollup to bundle the files
find the @values definition inside the bundled code
Context
Having many @value imports pollutes the final bundle with unused code.
Your Environment
Executable
Version
@modular-css/rollup
24.2.2
npm --version
6.4.1
node --version
10.15.3
OS
Version
NAME
VERSION
macOS Sierra
10.12.3
PS: This package is awesome!
The text was updated successfully, but these errors were encountered:
Not an accident, see #396 where this behavior was requested and #398 where it was implemented.
I'm open to it being an option (that defaults to true to avoid a breaking change) and would accept a PR to support that. For consistency across all the implementations the changes should happen in the processor package.
Okay, I created a PR that adds a config option exportValues to the processor which defaults to true. I realized the rollup-plugin as options named namedExports and styleExport, but I decided to stick to the naming used by the processor.
I had an issue running the tests on my local machine: for some reason the test for /rollup.js › watch mode › should generate updated output failed because the the file packages/rollup/test/output/watch/change/watched.js wasn't created. I'm not sure why or if this relates to my changes.
Expected Behavior
Values, which are imported via
@value myValue from "./foo.css"
are not bundled into the final JS files when using the rollup plugin.Current Behavior
Values do not show up in bundled JS files.
Possible Solution
This happens inside the
_add
function in the@modular-css/processor
package. I'm not sure why the values are included, but I deleted these lines in my local setup and couldn't find any issues. Is it possible to remove them from the export in general? Or maybe, if this is actually needed by other packages, could this be set as config option so that the rollup plugin could disable it?Steps to Reproduce (for bugs)
@modular-css/rollup
@values
@value
s definition inside the bundled codeContext
Having many
@value
imports pollutes the final bundle with unused code.Your Environment
@modular-css/rollup
npm --version
node --version
PS: This package is awesome!
The text was updated successfully, but these errors were encountered: