mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-04 12:47:44 +08:00
28 lines
731 B
JavaScript
28 lines
731 B
JavaScript
const CspHtmlWebpackPlugin = require('csp-html-webpack-plugin');
|
|
|
|
module.exports = function (mode, configs, webpack) {
|
|
if (mode === 'build') {
|
|
return {
|
|
plugins: [new CspHtmlWebpackPlugin({
|
|
'base-uri': "'self'",
|
|
'object-src': "'none'",
|
|
'script-src': [
|
|
"'self'"
|
|
],
|
|
'style-src': [
|
|
"'self'"
|
|
],
|
|
'connect-src': [
|
|
"'self'",
|
|
'http://adm.webank.io'
|
|
],
|
|
'img-src': [
|
|
'data:',
|
|
"'self'"
|
|
]
|
|
})]
|
|
};
|
|
}
|
|
return {};
|
|
};
|