-
Notifications
You must be signed in to change notification settings - Fork 135
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
sass web worker and cndjs #42
Comments
same problem with sass_sync and access domain origin
|
Interesting. At this point we can't XHR the file to inject it into the Worker instance as a blob, because |
the webworker and the mem file should be injected from extern for resolve this problem. |
I've just released 0.9.5, which inlines the memory file. This means there's only one file left that's loaded in the worker: I'm not sure about baking this into sass.js itself. I'd have probably used the |
@francescoagati does this problem still exist? |
@rodneyrehm Hi, stumpled over your project and would like to use it in an angular2 application using angular-cli and it's preconfigured webpack-configuration. Sync. version of the project works like a charm, but well, i would rather like to have the compilation run async. To get the async. version running i have to load the worker file, but the angular-cli only outputs one 'vendor.cachebustinghash.js' file for all imports and therefore i can't set a relative path to the worker-file - as i would have to import it to which would include it into vendor.cachebustinghash.js too... is their a possibility to set the worker-import directly instead of defining the path. Like: import Sass from 'sass.js/dist/sass.js';
import * as SassWorker from `'sass.js/dist/sass.worker.js'
// ...
constructor() {
console.log( 'SASS CONSTRUCTOR' );
Sass.setWorker( SassWorker );
this.$sass = new Sass( );
} Tought this sounded related to this question. |
@FloNeu there are ways to serialize a function to run as a worker, maybe that's a viable approach for you if you can load |
Well, that looks promising - thanks for your response, didn't know about that methods - highly appreciate it, will get back to you if i can make it work... |
I write the error message to improve SEO of this issue.
<script src="https://cdnjs.cloudflare.com/ajax/libs/sass.js/0.11.0/sass.js"></script>
<script>
var sass = new Sass();
var scss = '$someVar: 123px; .some-selector { width: $someVar; }';
sass.compile(scss, function(result) {
console.log(result);
});
</script> |
Hi,
using sass worker with cdnjs ins't possible for access domain origin. Can be possible pass a blob with js sass worker code, or passing directly an instance of the worker?
Thanks
The text was updated successfully, but these errors were encountered: