-
Notifications
You must be signed in to change notification settings - Fork 12k
chore(css): css preprocessors support enhancement #1492
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
Conversation
}, | ||
output: { | ||
path: path.resolve(projectRoot, './dist'), | ||
filename: '[name].css' |
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.
no hash
in output filename, hash will be required in prod build
@jkuri CSS/SASS files are part of source for project and it would be good if we have that under |
+1 to @sirajc for not using |
Instead of a fixed location, how about a configuration setting for global styles? Ideally the option would accept an array of files with glob support. This allows Where to put the option is the question. Does it fit in angular-cli.json? Or would it be better to add a separate config file for project specific build options? |
I'll update this in the next hours, but it is not quite sure this will be merged. |
We talked a bit more about this functionality, and this is the current plan:
|
We have component-name.css so why not index.css next to index.html? |
from: path.resolve(projectRoot, './public'), | ||
to: path.resolve(projectRoot, './dist'), | ||
ignore: ['**/*.sass', '**/*.scss', '**/*.styl', '**/*.less'] | ||
}]) |
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.
@jkuri public directory should be copied as is, in full. styles should be part of src
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.
thanks, reverted.
991c913
to
ecf8d51
Compare
@intellix you could change that in |
shouldn't the file be: |
ecf8d51
to
fb84d85
Compare
yes, thanks, was a long night. |
1c42b72
to
dba8714
Compare
Great work @jkuri, Thanks..., with this we can define styles like "apps": [
{
"main": "src/main.ts",
"tsconfig": "src/tsconfig.json",
"mobile": false,
"styles": [
"assets/vendor/paper.bootstrap.css",
"styles/index.scss"
]
}
] 👍 |
@sirajc no problem. I still have some minor improvements to do with injecting styles and write tests but this, I think, would be it. Actually the config looks like: "styles": {
"src/style.css": { "output": "style.css", "autoImported": true },
"src/app.sass": { "output": "app.css", "autoImported": true }
} but this will be noted in the readme for sure. In the meanwhile feel free to test this and report any bugs. Thanks. |
52ffe5b
to
9536ae5
Compare
c25fdd2
to
3862874
Compare
I managed to get mobile tests passing and working with app-shell prerender. |
@@ -60,10 +60,6 @@ export function getWebpackCommonConfig(projectRoot: string, sourceDir: string) { | |||
}, | |||
plugins: [ | |||
new ForkCheckerPlugin(), | |||
new HtmlWebpackPlugin({ |
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.
Why is this removed?
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.
We have a custom plugin for that which injects .css
files configured with autoImported: true
into index.html
. In this plugin we have also configuration for mobile support which generates content automactically (app-shell).
this PR does not follow the proper design so I am closing it. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This addon allows "global" CSS extension language files in
public/
dir which are then merged todist/app.css
and that file can be included inindex.html
.This webpack build runs concurrently with the main build compilation.