-
Notifications
You must be signed in to change notification settings - Fork 71
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
Preprocessing #31
Preprocessing #31
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.
Changes look good from my side apart from a few formating errors (we use tabs instead of spaces across JS files).
However, they seem to break the emitCSS
option (cf. Travis). Is this something that was changed in Svelte > 1.0.6? If that is the case you'd need to adjust this test case, too.
@@ -31,8 +32,8 @@ module.exports = function(source, map) { | |||
|
|||
if (!options.name) options.name = capitalize(sanitize(options.filename)); | |||
|
|||
try { | |||
let { code, map, css, cssMap } = compile(source, options); | |||
preprocess(source, options).then(processed => { |
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.
Use tabs instead of spaces.
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.
Will do, thanks!
test/loader.spec.js
Outdated
resourcePath: 'test/fixtures/style-valid.html', | ||
options, | ||
}, | ||
fileContents, |
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.
Fix formating; use tabs instead of spaces.
index.js
Outdated
@@ -44,10 +45,10 @@ module.exports = function(source, map) { | |||
utimesSync(tmpobj.name, stats.atimeMs - 9999, stats.mtimeMs - 9999); | |||
} | |||
|
|||
this.callback(null, code, map); |
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.
Formating: use tabs instead of spaces.
The weird thing is that I do have adapted the test cases to be async and they all pass in my local machine. It could be some sort of permission limitation in travis, cause we write in a temp file, although |
a8571b1
to
153ccbe
Compare
c287643
to
23fc3ab
Compare
Found the issue in tests, in node 8.0.0 the |
23fc3ab
to
23a0014
Compare
Hm, now that I think of it we should better make the loader compatible with earlier versions of node as well. I updated the change. |
Please ensure that we test this on travis, too. Just add the additional node versions you'd like to test to In my opinion testing |
On it! |
According to this we should cover 6.x, 8.x and latest 9. The problem with the previous error was that from 8.0 the api changed, within the 8.x range. Anyway, I suggest the following:
|
5522f90
to
8b777f6
Compare
OK, putting |
Thank you! Released as 2.3.0 🎉 |
Utilized
svelte.preprocess
introduced to svelte in v1.44.0