diff --git a/generators/assets/webpack/templates/package.json.tmpl b/generators/assets/webpack/templates/package.json.tmpl index 532676f5a..60295f632 100644 --- a/generators/assets/webpack/templates/package.json.tmpl +++ b/generators/assets/webpack/templates/package.json.tmpl @@ -20,6 +20,7 @@ "extract-text-webpack-plugin": "2.1.2", "file-loader": "~0.11.2", "font-awesome": "~4.7.0", + "gopherjs-loader": "^0.0.1", "jquery": "~3.2.1", "jquery-ujs": "~1.2.2", "node-sass": "~4.5.3", diff --git a/generators/assets/webpack/templates/webpack.config.js.tmpl b/generators/assets/webpack/templates/webpack.config.js.tmpl index f09843356..713d5beeb 100644 --- a/generators/assets/webpack/templates/webpack.config.js.tmpl +++ b/generators/assets/webpack/templates/webpack.config.js.tmpl @@ -14,8 +14,8 @@ var entries = { } glob.sync("./assets/*/*.*").reduce((_, entry) => { - let key = entry.replace(/(\.\/assets\/(js|css)\/)|(.js|.scss)/g, '') - if(key.startsWith("_") || (/(js|scss)$/i).test(entry) == false) { + let key = entry.replace(/(\.\/assets\/(js|css|go)\/)|(.js|.scss|.go)/g, '') + if(key.startsWith("_") || (/(js|scss|go)$/i).test(entry) == false) { return } @@ -110,6 +110,10 @@ module.exports = { { test: require.resolve("jquery"), use: "expose-loader?jQuery!expose-loader?$" + }, + { + test: /\.go$/, + use: "gopherjs-loader" } ] }