Skip to content

Commit 39a8c16

Browse files
committed
Update for Elm 0.19
1 parent 7d1c6d9 commit 39a8c16

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var alreadyCompiledFiles = [];
1212
var defaultOptions = {
1313
cache: false,
1414
forceWatch: false,
15-
yes: true
1615
};
1716

1817
var getFiles = function(options) {
@@ -38,9 +37,7 @@ var getOptions = function() {
3837
? this.options.elm || {}
3938
: this.query.elm || {};
4039
var loaderOptions = loaderUtils.getOptions(this) || {};
41-
return Object.assign({
42-
emitWarning: this.emitWarning
43-
}, defaultOptions, globalOptions, loaderOptions);
40+
return Object.assign({}, defaultOptions, globalOptions, loaderOptions);
4441
};
4542

4643
var _addDependencies = function(dependency) {
@@ -76,10 +73,10 @@ var isInWatchMode = function(){
7673
return hasWebpackDevServer || hasWatchArg || hasStdinArg;
7774
};
7875

79-
/* Takes a working dir, tries to read elm-package.json, then grabs all the modules from in there
76+
/* Takes a working dir, tries to read elm.json, then grabs all the modules from in there
8077
*/
8178
var filesToWatch = function(cwd){
82-
var readFile = fs.readFileSync(path.join(cwd, "elm-package.json"), 'utf8');
79+
var readFile = fs.readFileSync(path.join(cwd, "elm.json"), 'utf8');
8380
var elmPackage = JSON.parse(readFile);
8481

8582
var paths = elmPackage["source-directories"].map(function(dir){
@@ -127,11 +124,11 @@ module.exports = function() {
127124
if (options.forceWatch || isInWatchMode()){
128125
// we can do a glob to track deps we care about if cwd is set
129126
if (typeof options.cwd !== "undefined" && options.cwd !== null){
130-
// watch elm-package.json
131-
var elmPackage = path.join(options.cwd, "elm-package.json");
127+
// watch elm.json
128+
var elmPackage = path.join(options.cwd, "elm.json");
132129
addDependencies(elmPackage);
133130
var dirs = filesToWatch(options.cwd);
134-
// watch all the dirs in elm-package.json
131+
// watch all the dirs in elm.json
135132
addDirDependency.bind(this)(dirs);
136133
}
137134

@@ -214,4 +211,4 @@ function remove(condemned, items) {
214211
return items.filter(function(item) {
215212
return item !== condemned;
216213
});
217-
}
214+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"elm": "^0.18.0",
2929
"glob": "^7.1.1",
3030
"loader-utils": "^1.0.2",
31-
"node-elm-compiler": "^4.5.0",
31+
"node-elm-compiler": "^5.0.0-alpha1",
3232
"yargs": "^6.5.0"
3333
},
3434
"devDependencies": {

0 commit comments

Comments
 (0)