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
# ls -la /Users/aleonov/dev/parcel-import-issue-reproduce/src/themes/default/
total 16
drwxr-xr-x 4 aleonov staff 128 Dec 18 15:47 .
drwxr-xr-x 3 aleonov staff 96 Dec 18 15:47 ..
-rw-r--r-- 1 aleonov staff 60 Dec 18 15:47 colors.css
-rw-r--r-- 1 aleonov staff 113 Dec 18 15:47 theme.css
💁 Possible Solution
🔦 Context
Trying to implement themes using parcel and parcel-plugin-css-regex-replace plugin.
I'm placing placeholder in css file like: @import 'theme_import_placeholder';
and replacing it with absolute path of the file that contains theme colours set up on build time with parcel-plugin-css-regex-replace plugin: @import '/Users/aleonov/dev/parcel-import-issue-reproduce/src/themes/default/theme.css';
Yeah, this will probably never be supported. (although in parcel 2 there will be the possibility to write a custom resolver to support this)
Supporting absolute paths that are not relative to the project are a bad idea as it might leak your file structure to the bundles which might be a security risk.
The more important reason this is a bad idea is because it would break if the file structure changes, and a project should only rely on files inside the project folder not random files all across your computer.
@DeMoorJasper Thanks a lot for your reply. I just saw #1986 that was fixed and thought it was kind of regression.
Regarding structure change. It's just replaced at build time. So if the file structure changes this would be changed too.
🐛 bug report
Parcel does not resolve absolute path CSS modules.
Issue looks exact as this
🎛 Configuration (.babelrc, package.json, cli command)
package.json:
🤔 Expected Behavior
Parcel resolves path successfully.
😯 Current Behavior
Parcel fails to build with error:
💁 Possible Solution
🔦 Context
Trying to implement themes using
parcel
andparcel-plugin-css-regex-replace
plugin.I'm placing placeholder in css file like:
@import 'theme_import_placeholder';
and replacing it with absolute path of the file that contains theme colours set up on build time with
parcel-plugin-css-regex-replace
plugin:@import '/Users/aleonov/dev/parcel-import-issue-reproduce/src/themes/default/theme.css';
💻 Code Sample
repo: https://github.com/anivle/parcel-import-issue-reproduce
🌍 Your Environment
The text was updated successfully, but these errors were encountered: