Skip to content

Commit 5f6a96b

Browse files
committed
tweaks from review
1 parent 04fa4be commit 5f6a96b

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

dist/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ var _controllers = _interopRequireDefault(require("./webpack/loader!@symfony/sti
2121

2222
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2323

24-
// this import is be replaced by the NormalModuleReplacementPlugin
25-
// to point to the real controllers.json file
26-
// See create-controllers-module.js
24+
// The @symfony/stimulus-bridge/controllers.json should be changed
25+
// to point to the real controllers.json file via a Webpack alias
2726
function startStimulusApp(context) {
2827
var application = _stimulus.Application.start();
2928

dist/webpack/create-controllers-module.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@ module.exports = function createControllersModule(config) {
4141
var webpackMode = controllerUserConfig.webpackMode;
4242
controllerContents += "\n '" + controllerReference + '\': import(/* webpackMode: "' + webpackMode + '" */ \'' + controllerMain + "'),";
4343

44-
if ('undefined' !== typeof controllerUserConfig.autoimport) {
45-
for (var autoimport in controllerUserConfig.autoimport) {
46-
if (!controllerUserConfig.autoimport[autoimport]) {
47-
continue;
48-
}
49-
44+
for (var autoimport in controllerUserConfig.autoimport || []) {
45+
if (controllerUserConfig.autoimport[autoimport]) {
5046
autoImportContents += "import '" + autoimport + "';\n";
5147
}
5248
}

src/webpack/create-controllers-module.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,8 @@ module.exports = function createControllersModule(config) {
5555
controllerMain +
5656
"'),";
5757

58-
if ('undefined' !== typeof controllerUserConfig.autoimport) {
59-
for (let autoimport in controllerUserConfig.autoimport) {
60-
if (!controllerUserConfig.autoimport[autoimport]) {
61-
continue;
62-
}
63-
58+
for (let autoimport in controllerUserConfig.autoimport || []) {
59+
if (controllerUserConfig.autoimport[autoimport]) {
6460
autoImportContents += "import '" + autoimport + "';\n";
6561
}
6662
}

0 commit comments

Comments
 (0)