Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We��ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep imports and mark them as external #346

Open
AndyOGo opened this issue Dec 11, 2020 · 0 comments
Open

Keep imports and mark them as external #346

AndyOGo opened this issue Dec 11, 2020 · 0 comments

Comments

@AndyOGo
Copy link

AndyOGo commented Dec 11, 2020

I build a component library and I only want to transform SCSS files to CSS files and keep the import statements renamed to the CSS file.
The user of the library is then free to decide which loader he uses and how the CSS is delivered to the browser.
Like @rollup/plugin-typescript does it, it also renames the imports from *.ts to *.js and generates the transpiled files.

Input:

- src
   index.js
   index.css
import "./index.css";

Output:

- dist
   index.js
   index.css
// change only the extension.
import "./foo.css";

I made a contrived example using the resolveId hook with the external option:
https://repl.it/@AndyOGo/OldfashionedAnnualCache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant