Skip to content
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

Prepare for rollup 1.0 #45

Merged
merged 3 commits into from
Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function mkdirp(dir) {
}

class CssWriter {
constructor (code, map) {
constructor (code, map, warn) {
this.code = code;
this.map = {
version: 3,
Expand All @@ -83,6 +83,7 @@ class CssWriter {
names: [],
mappings: map.mappings
};
this.warn = warn;
}

write(dest, map) {
Expand All @@ -107,7 +108,7 @@ class CssWriter {
}

toString() {
console.log('[DEPRECATION] As of rollup-plugin-svelte@3, the argument to the `css` function is an object, not a string — use `css.write(file)`. Consult the documentation for more information: https://github.com/rollup/rollup-plugin-svelte'); // eslint-disable-line no-console
this.warn('[DEPRECATION] As of rollup-plugin-svelte@3, the argument to the `css` function is an object, not a string — use `css.write(file)`. Consult the documentation for more information: https://github.com/rollup/rollup-plugin-svelte');
return this.code;
}
}
Expand Down Expand Up @@ -228,7 +229,7 @@ module.exports = function svelte(options = {}) {
return compiled.js;
});
},
ongenerate() {
generateBundle() {
if (css) {
// write out CSS file. TODO would be nice if there was a
// a more idiomatic way to do this in Rollup
Expand Down Expand Up @@ -265,7 +266,7 @@ module.exports = function svelte(options = {}) {
sources,
sourcesContent,
mappings: encode(mappings)
});
}, this.warn);

css(writer);
}
Expand Down