Skip to content

Commit

Permalink
chore: release
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh3112 committed Jan 7, 2021
1 parent a49ea8c commit d85f517
Show file tree
Hide file tree
Showing 9 changed files with 6,342 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules
template/node_modules
template/package-lock.json
template/package-lock.json
test/scaffold/webpack.config.js
test/scaffold/.yo-rc.json
test/scaffolder
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test/
node_modules/
607 changes: 607 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
},
"devDependencies": {
"@webpack-cli/generators": "^1.2.1",
"@webpack-cli/init": "^1.1.1",
"webpack": "^5.11.1",
"webpack-cli": "^4.3.1"
},
"bin": {
Expand Down
14 changes: 8 additions & 6 deletions template/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ module.exports = class WebpackGenerator extends Generator {
constructor(args, opts) {
super(args, opts);
this.dependences = ["webpack", "webpack-cli"];
opts.env.configuration = {
dev: {
topScope: ["// genrated using webpack-scaffold-<name>"],
this.configuration = {
config: {
configName: "config",
topScope: ["// generated using webpack-scaffold-<name>"],
webpackOptions: {}
}
}
Expand All @@ -40,7 +41,7 @@ module.exports = class WebpackGenerator extends Generator {
done();
} else {
console.log("Okay, Exiting...");
process.exit();
process.exit(0);
}
})
}
Expand All @@ -49,7 +50,7 @@ module.exports = class WebpackGenerator extends Generator {
* @description write files in user directory
*/
writing() {
this.config.set('configuration', this.options.env.configuration);
this.config.set('configuration', this.configuration);
}

/**
Expand All @@ -58,6 +59,7 @@ module.exports = class WebpackGenerator extends Generator {
*/
install() {
const pkgManager = getPackageManager();
this.scheduleInstallTask(pkgManager, this.dependences);
const opts = pkgManager === 'yarn' ? { dev: true } : { 'save-dev': true };
this.scheduleInstallTask(pkgManager, this.dependences, opts);
}
};
4 changes: 3 additions & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"yeoman-generator": "^3.2.0"
},
"devDependencies": {
"@webpack-cli/generators": "^0.1.5"
"@webpack-cli/generators": "^0.1.5",
"webpack-cli": "^4.3.1",
"webpack": "^5.11.1"
},
"author": "",
"license": "MIT"
Expand Down
Loading

0 comments on commit d85f517

Please sign in to comment.