Skip to content

Support for DtsCreator parameters via query parameters #5

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

Merged
merged 10 commits into from
Aug 16, 2016

Conversation

Naycon
Copy link
Contributor

@Naycon Naycon commented Aug 16, 2016

This pull request adds support for passing options to the DtsCreator (typed-css-modules) instance via webkits query parameters. I might as well contribute the code here even though I ended up not needing it.

// you change the default options of the DtsCreator and e.g. use a different
// output folder.
var queryOptions = loaderUtils.parseQuery(this.query);
var options;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will DtsCreator accept undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, if options isn't defined, it will just go on and use the defaults. If I'm not mistaken, new DtsCreator() and new DtsCreator(undefined) is going to be the exact same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it btw, since in the end it turned out I didn't need to pass any options to the loader, thus having an undefined options object.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, cool =)

@olegstepura
Copy link
Owner

Could you be so kind to update README as well? People should know about such possibility.

@olegstepura
Copy link
Owner

I suggest removing the sentence "Has no configuration atm." and adding a new paragraph describing how to pass options in the webpack configuration. A link to the page where possible options are described will be very handy.

Thanks!

@Naycon
Copy link
Contributor Author

Naycon commented Aug 16, 2016

Oh, sorry! Of course the README should be updated! I'll fix that.

@Naycon
Copy link
Contributor Author

Naycon commented Aug 16, 2016

@olegstepura - now the readme is updated as well. I updated the example as well, as I think there was a typo there. Can you please check that it is correct now, so I haven't misunderstood how to specify the loader (I'm using webpack indirectly via roc.js)?

@@ -22,7 +22,7 @@ const settings = {
{
test: /\.css$/,
exclude: /node_modules/,
loader: 'typed-css-modules'
loader: 'typed-css-modules-loader'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Webpack allows to specify loaders without -loader suffix. See https://webpack.github.io/docs/using-loaders.html#referencing-loaders

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. I'll revert the commit that made the change. TIL. =)

@Naycon
Copy link
Contributor Author

Naycon commented Aug 16, 2016

Now everything should be up to date with the changes you made on my fork. Feel free to merge.

@olegstepura olegstepura merged commit 5977d1a into olegstepura:master Aug 16, 2016
@olegstepura
Copy link
Owner

@Naycon Thanks for your improvements!

@Naycon
Copy link
Contributor Author

Naycon commented Aug 16, 2016

👍

olegstepura added a commit that referenced this pull request Aug 16, 2016
@olegstepura
Copy link
Owner

olegstepura commented Aug 16, 2016

FYI: I've published new version to npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants