generator-angular2-library
generator-angular2-library copied to clipboard
Build "Error: Octal literal in strict mode" when css with content:"\123"
In a library created with this generator (Thanks! It's awesome) I use a css like this:
.css-class:before {
content: "\62";
}
Building with npm run build
I have an error:
Starting 'rollup:fesm'...
events.js:160
throw er; // Unhandled 'error' event
^
Error: Octal literal in strict mode
at error (C:\Microarea\fabriziodebortoli\ng-icon\node_modules\rollup\dist\rollup.js:170:12)
at Module.error$1 [as error] (C:\Microarea\fabriziodebortoli\ng-icon\node_modules\rollup\dist\rollup.js:8007:2)
at tryParse (C:\Microarea\fabriziodebortoli\ng-icon\node_modules\rollup\dist\rollup.js:7710:10)
at new Module (C:\Microarea\fabriziodebortoli\ng-icon\node_modules\rollup\dist\rollup.js:7745:14)
at C:\Microarea\fabriziodebortoli\ng-icon\node_modules\rollup\dist\rollup.js:9495:17
at process._tickCallback (internal/process/next_tick.js:109:7)
What can I try to do?
This is an example of library: https://github.com/fabriziodebortoli/ng-icon
You could use useStrict: false
to disable that check, writing that line here. I haven't tested it, but I think it will work you 👍
@fabriziodebortoli — Can you try to escape the value:
content: "\\62";
and let us know if that works? Thanks!
You could use useStrict: false to disable that check, writing that line here. I haven't tested it, but I think it will work you 👍
@xxxtonixxx thanks but this is only a workaround, I would like to resolve... And rollup documentation says: ES6 modules are always in strict mode, so you shouldn't disable this without good reason.
Edit: I wanted to try the same but the option "useStrict" in the "gulp-rollup" is not used...
@jvandemo - Escaping, build is ok but the icons will not be visible because the css "content" mapping will be wrong
Hi ! Same problem here, by importing bootstrap-sass :
$icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";
@import "~bootstrap-sass/assets/stylesheets/bootstrap";
I also have this problem when importing bootstrap library. Any ideas how to handle this? If I escape all the value with "{number}" in bootstrap node_modules everything works, but I don't want to change things in my node_modules..