Skip to content

Commit

Permalink
fix: add support for plugins specifying a uint8array webpack loader
Browse files Browse the repository at this point in the history
  • Loading branch information
starpit committed Apr 25, 2023
1 parent e508a85 commit 5738484
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/webpack/headless-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ allKuiPlugins.forEach(dir => {
})
})
}
if (kui.webpack.rules['uint8array-loader']) {
kui.webpack.rules['uint8array-loader'].forEach(test => {
kuiPluginRules.push({
test: new RegExp(test.replace(/(\S)\/(\S)/g, `$1\\${path.sep}$2`)),
type: 'javascript/auto',
loader: 'encoded-uint8array-loader'
})
})
}
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"crypto-browserify": "^3.12.0",
"css-loader": "^6.7.3",
"css-minimizer-webpack-plugin": "^5.0.0",
"encoded-uint8array-loader": "^1.0.3",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"https-browserify": "^1.0.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ const pluginEntries = allKuiPlugins.map(dir => {
})
})
}
if (kui.webpack.rules['uint8array-loader']) {
kui.webpack.rules['uint8array-loader'].forEach(test => {
kuiPluginRules.push({
test: new RegExp(test.replace(/(\S)\/(\S)/g, `$1\\${path.sep}$2`)),
type: 'javascript/auto',
loader: 'encoded-uint8array-loader'
})
})
}
}
}

Expand Down

0 comments on commit 5738484

Please sign in to comment.