Skip to content

Use node-interpret to import configuration in various formats. - #949

Merged
sokra merged 1 commit into
webpack:masterfrom
monder:master
Apr 7, 2015
Merged

sokra merged 1 commit into
webpack:masterfrom
monder:master

Conversation

@monder

@monder monder commented Apr 6, 2015

Copy link
Copy Markdown
Contributor

This is a possible solution for #475.
Support for *.coffee configuration files is implemented using node-interpret.
Other formats work as well:

webpack --config webpack.config.coffee
webpack --config webpack.config.json

P.S. Are there any tests to cover CLI?

sokra added a commit that referenced this pull request Apr 7, 2015
Use node-interpret to import configuration in various formats.
@sokra
sokra merged commit b305988 into webpack:master Apr 7, 2015
@sokra

sokra commented Apr 7, 2015

Copy link
Copy Markdown
Member

Thanks

@tiye

tiye commented Apr 7, 2015

Copy link
Copy Markdown
Contributor

@monder I love writing CoffeeScript. I got a question here. CLI tools like Gulp which supports CoffeeScript run without specifying a filename. As I tried, Webpack 1.8.0 does not recognize webpack.config.coffee by itself. Is that by purpose?

@monder

monder commented Apr 7, 2015

Copy link
Copy Markdown
Contributor Author

Yes. I suppose that we should have single config file format by default (webpack.config.js) and everything else needs to be specified explicitly to load the correct module for parsing.

@akre54

akre54 commented Apr 7, 2015

Copy link
Copy Markdown
Contributor

We could also do what Gulp (liftoff) does and try to find the first matching config file without needing to pass a flag.

@sokra

sokra commented Apr 7, 2015

Copy link
Copy Markdown
Member

Send a PR...

@akre54

akre54 commented Apr 7, 2015

Copy link
Copy Markdown
Contributor

Been meaning to. Will take a stab when I get some time.

@akre54

akre54 commented Apr 8, 2015

Copy link
Copy Markdown
Contributor

Thanks @jiyinyiyong. I ended up just borrowing some logic from liftoff but that is handy.

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.

4 participants