Skip to content

Commit c84e587

Browse files
committed
Support CoffeeScript configuration files
Simply add --coffee to the webpack invocation and it will read coffeescript configuration files if available or when specified. Doesn't add `coffee-script` dependency to webpack install, that's up to the user. Fixes webpack#475
1 parent cd5252b commit c84e587

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎bin/convert-argv.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,19 @@ module.exports = function(optimist, argv, convertOptions) {
2626
argv["optimize-occurence-order"] = true;
2727
}
2828

29+
if(argv.coffee) {
30+
require('coffee-script/register');
31+
}
32+
2933
if(argv.config) {
3034
options = require(path.resolve(argv.config));
3135
} else {
32-
var configPath = path.resolve("webpack.config.js");
33-
if(fs.existsSync(configPath)) {
36+
var configPath = path.resolve("webpack.config");
37+
try {
3438
options = require(configPath);
39+
} catch (e) {
40+
console.log("Could not load configuration:\n", e);
41+
process.exit(-1);
3542
}
3643
}
3744
if(typeof options !== "object" || options === null) {

0 commit comments

Comments
 (0)