Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Gopherjs add to template #862

Merged
merged 2 commits into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions generators/assets/webpack/templates/package.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 6 additions & 2 deletions generators/assets/webpack/templates/webpack.config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -110,6 +110,10 @@ module.exports = {
{
test: require.resolve("jquery"),
use: "expose-loader?jQuery!expose-loader?$"
},
{
test: /\.go$/,
use: "gopherjs-loader"
}
]
}
Expand Down