-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support for classic apps #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All together this is very very good 🎉 I had a few comments but nothing too bad
let htmlbarsPlugin = plugins.find( | ||
(p) => p._parallelBabel?.params?.templateCompilerPath | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we think this is good enough to identify the htmlbars plugin? there are no other more specific ways to find this?
|
||
let customPlugin = [require.resolve('../dist/scoped-babel-plugin.cjs')]; | ||
|
||
plugins.splice(htmlbarsPluginIndex - 1, 0, customPlugin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this break if htmlbarsPlugin is the first in the list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
let htmlbarsPlugin = plugins.find( | ||
(p) => p._parallelBabel?.params?.templateCompilerPath | ||
); | ||
if (htmlbarsPlugin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we not need an else with this if?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how it could happen. I believe, that the plugin has to be there in every application.
let preprocessors = registry.load('css'); | ||
preprocessors.forEach((p) => registry.remove('css', p)); | ||
this.outputStylePreprocessor.preprocessors = preprocessors; | ||
registry.add('css', this.outputStylePreprocessor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment ahead of this to explain that we needed to make sure that we run ours first (and that we couldn't find any ember-cli way to make it happen first)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for suggestion
// ignore css files for ember-css-modules | ||
if (relativePath.endsWith('.module.css')) { | ||
return ''; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this needs to be configurable 🤔 since ember-css-modules could be configured with anything
This PR adds support for classic apps.
CSS files are rewritten by css preprocessor.
A babel plugin rewrites templates.