Skip to content

Commit b4bfafb

Browse files
committedMar 25, 2018
fix(loader,plugin): fix generators path bug
1 parent 0de8a4e commit b4bfafb

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
 

‎lib/generators/loader-generator.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const LoaderGenerator = webpackGenerator(
3636
validate: str => str.length > 0
3737
}
3838
],
39-
path.join(__dirname, "templates"),
39+
path.join(__dirname, "../generate-loader/templates"),
4040
[
4141
"src/cjs.js.tpl",
4242
"test/test-utils.js.tpl",
@@ -48,7 +48,9 @@ const LoaderGenerator = webpackGenerator(
4848
"examples/simple/src/lazy-module.js.tpl",
4949
"examples/simple/src/static-esm-module.js.tpl"
5050
],
51-
["src/_index.js.tpl"],
51+
[
52+
"src/_index.js.tpl"
53+
],
5254
gen => ({ name: gen.props.name })
5355
);
5456

‎lib/generators/plugin-generator.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const PluginGenerator = webpackGenerator(
2121
validate: str => str.length > 0
2222
}
2323
],
24-
path.join(__dirname, "templates"),
24+
path.join(__dirname, "../generate-plugin/templates"),
2525
[
2626
"src/cjs.js.tpl",
2727
"test/test-utils.js.tpl",
@@ -30,7 +30,10 @@ const PluginGenerator = webpackGenerator(
3030
"examples/simple/src/lazy-module.js.tpl",
3131
"examples/simple/src/static-esm-module.js.tpl"
3232
],
33-
["src/_index.js.tpl", "examples/simple/_webpack.config.js.tpl"],
33+
[
34+
"src/_index.js.tpl",
35+
"examples/simple/_webpack.config.js.tpl"
36+
],
3437
gen => ({ name: _.upperFirst(_.camelCase(gen.props.name)) })
3538
);
3639

0 commit comments

Comments
 (0)
Please sign in to comment.