mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Yeoman generator now installs NPM/DNX dependencies and runs webpack
This commit is contained in:
@@ -36,7 +36,7 @@ class MyGenerator extends yeoman.Base {
|
||||
this._answers.namePascalCase = toPascalCase(answers.name);
|
||||
this._answers.projectGuid = uuid.v4();
|
||||
done();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
writing() {
|
||||
@@ -52,6 +52,26 @@ class MyGenerator extends yeoman.Base {
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
installingDeps() {
|
||||
// Strictly speaking, with DNX, the 'prepare' script runs 'npm install' anyway so we don't really need
|
||||
// to run it from here. But it will be needed with RC2, and it doesn't make the setup take much longer
|
||||
// because the second run is almost a no-op, so it's OK to leave it here for now.
|
||||
this.installDependencies({
|
||||
npm: true,
|
||||
bower: false,
|
||||
callback: () => {
|
||||
this.spawnCommandSync('dnu', ['restore']);
|
||||
|
||||
// With DNX, the 'prepare' script builds the vendor files automatically so the following is not
|
||||
// required. With RC2 and the 'dotnet' tooling, that won't happen automatically, so the following
|
||||
// will be required:
|
||||
// this.spawnCommandSync('./node_modules/.bin/webpack', ['--config', 'webpack.config.vendor.js']);
|
||||
|
||||
this.spawnCommandSync('./node_modules/.bin/webpack');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
declare var module: any;
|
||||
|
||||
Reference in New Issue
Block a user