diff --git a/packages/fes-cli/package.json b/packages/fes-cli/package.json index 9b767826..52a5e07f 100644 --- a/packages/fes-cli/package.json +++ b/packages/fes-cli/package.json @@ -1,6 +1,6 @@ { "name": "@webank/fes-cli", - "version": "0.1.3", + "version": "0.1.4", "description": "一个好用的前端管理台快速开发框架", "preferGlobal": true, "scripts": { diff --git a/packages/fes-template/fes.config.js b/packages/fes-template/fes.config.js index b805c841..7dcb15ea 100644 --- a/packages/fes-template/fes.config.js +++ b/packages/fes-template/fes.config.js @@ -108,7 +108,7 @@ module.exports = { } ], i18n: { - locale: 'en', // default zh-cn + locale: 'zh-cn', // default zh-cn messages: { 'zh-cn': { menu: { diff --git a/packages/fes-template/package.json b/packages/fes-template/package.json index 47c800dd..c3b3592e 100644 --- a/packages/fes-template/package.json +++ b/packages/fes-template/package.json @@ -1,6 +1,6 @@ { "name": "@webank/fes-template", - "version": "0.1.2", + "version": "0.1.3", "description": "fes项目模版", "main": "index.js", "scripts": { @@ -29,6 +29,7 @@ "author": "harrywan qlin", "license": "MIT", "devDependencies": { + "csp-html-webpack-plugin": "^4.0.0", "@webank/eslint-config-webank": "^0.1.4" }, "dependencies": { diff --git a/packages/fes-template/webpack.config.js b/packages/fes-template/webpack.config.js new file mode 100644 index 00000000..2358820d --- /dev/null +++ b/packages/fes-template/webpack.config.js @@ -0,0 +1,27 @@ +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://example.com' + ], + 'img-src': [ + 'data:', + "'self'" + ] + })] + }; + } + return {}; +}; \ No newline at end of file