Replies: 5 comments
-
I don't fully understand what you are trying to import from where, but: There is a way to import a new child asset: asset.addDepenedency({ moduleSpecifier: "XYZ"});
var assets = [
{
type: 'js',
content: js,
},
{
type: 'scss',
content: css,
uniqueKey: "XYZ"
}
] (Similar: parcel/packages/transformers/html/src/inline.js Lines 85 to 99 in 46e8ffa If this doesn't work in your situation, please provide more details and/or more code samples |
Beta Was this translation helpful? Give feedback.
-
@mischnic Thanks for your reply. It is something different.
Minimal examplefancy-button.lol - contains just styles for the example sake
fancy-button.scss - this is generated Parcel 2 asset from fancy-button.lol; it does not exist on disk
app.lol
How can I reference such generated |
Beta Was this translation helpful? Give feedback.
-
I see
This asset doesn't exist on any filesystem. I think using the SCSS transformer isn't possible in this case because a transformer doesn't have access to another transformer's result (including children) as they run in parallel. Other possibilities would be a packager or running SCSS manually in your transformer (and using a custom importer like here: )Looks like this language is similar to svelte? |
Beta Was this translation helpful? Give feedback.
-
I'm so glad you pointed me in a direction. Thanks. Yeah
and all that goodies contained in 7kB gzipped runtime bundle flat. It works and it took me ~200LOC to develop in Parcel 2. |
Beta Was this translation helpful? Give feedback.
-
It turned out that it is way easier to watch for changes in 'src' dir (chokidar) and run 'transpile(..)' on changed '.lol' files. Parcel 2 watches for changes in 'manually-transpiled' directory |
Beta Was this translation helpful? Give feedback.
-
I wrote a transformer for lol-lang.
*.lol
- transforms into ->*.scss
+*.js
Is it possible that I can access this
scss
generated asset from source code?Im asking because there is a mixin generated in that
scss
asset. I want to import it in source code. However I try, my code does not see it.app.lol
.parcelrc
Any hints?
Beta Was this translation helpful? Give feedback.
All reactions