mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-12-02 19:58:18 +08:00
Merge branch 'vue3' of https://github.com/WeBankFinTech/fes.js into vue3
This commit is contained in:
commit
9cf2d08d2d
@ -19,7 +19,8 @@ const headPkgs = [
|
||||
"fes-plugin-jest",
|
||||
"fes-plugin-vuex",
|
||||
"create-fes-app",
|
||||
"fes-plugin-qiankun"
|
||||
"fes-plugin-qiankun",
|
||||
"fes-plugin-sass"
|
||||
];
|
||||
const tailPkgs = [];
|
||||
// const otherPkgs = readdirSync(join(__dirname, 'packages')).filter(
|
||||
|
@ -2,11 +2,10 @@
|
||||
|
||||
|
||||
export default {
|
||||
base: '',
|
||||
define: {
|
||||
__DEV__: false
|
||||
},
|
||||
publicPath: '/',
|
||||
publicPath: './',
|
||||
access: {
|
||||
roles: {
|
||||
admin: ["/", "/onepiece"]
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
|
||||
export default {
|
||||
publicPath: 'https://gw.alipayobjects.com/'
|
||||
publicPath: ''
|
||||
};
|
||||
|
3
packages/fes-plugin-sass/.fatherrc.js
Normal file
3
packages/fes-plugin-sass/.fatherrc.js
Normal file
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
disableTypeCheck: false,
|
||||
};
|
21
packages/fes-plugin-sass/LICENSE
Normal file
21
packages/fes-plugin-sass/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-present webank
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
3
packages/fes-plugin-sass/README.md
Normal file
3
packages/fes-plugin-sass/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# fes
|
||||
|
||||
一个好用的前端应用解决方案
|
36
packages/fes-plugin-sass/package.json
Normal file
36
packages/fes-plugin-sass/package.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "@fesjs/plugin-sass",
|
||||
"version": "2.0.0-rc.1",
|
||||
"description": "@fesjs/plugin-sass",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/WeBankFinTech/fes.js.git",
|
||||
"directory": "packages/fes-plugin-sass"
|
||||
},
|
||||
"keywords": [
|
||||
"fes"
|
||||
],
|
||||
"author": "harrywan",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/WeBankFinTech/fes.js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/WeBankFinTech/fes.js#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"sass": "^1.32.11",
|
||||
"sass-loader": "^11.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@fesjs/fes": "^2.0.0-rc.0"
|
||||
}
|
||||
}
|
37
packages/fes-plugin-sass/src/index.js
Normal file
37
packages/fes-plugin-sass/src/index.js
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
export default (api) => {
|
||||
const {
|
||||
utils
|
||||
} = api;
|
||||
|
||||
api.describe({
|
||||
key: 'sass',
|
||||
config: {
|
||||
schema(joi) {
|
||||
return joi.object({
|
||||
implementation: joi.any(),
|
||||
sassOptions: joi.object(),
|
||||
prependData: joi.alternatives(joi.string(), joi.func()),
|
||||
sourceMap: joi.boolean(),
|
||||
webpackImporter: joi.boolean()
|
||||
});
|
||||
},
|
||||
default: {}
|
||||
}
|
||||
});
|
||||
|
||||
api.chainWebpack((memo, { createCSSRule }) => {
|
||||
createCSSRule({
|
||||
lang: 'sass',
|
||||
test: /\.(sass|scss)(\?.*)?$/,
|
||||
loader: require.resolve('sass-loader'),
|
||||
options: utils.deepmerge(
|
||||
{
|
||||
implementation: require('sass')
|
||||
},
|
||||
api.config.sass || {}
|
||||
)
|
||||
});
|
||||
return memo;
|
||||
});
|
||||
};
|
@ -106,4 +106,14 @@ export default function createCssWebpackConfig({
|
||||
sourceMap: config.devtool !== false
|
||||
}]);
|
||||
}
|
||||
|
||||
return (options) => {
|
||||
createRules({
|
||||
isDev,
|
||||
config,
|
||||
webpackConfig,
|
||||
browserslist,
|
||||
...options
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ export default async function getConfig({
|
||||
.options(babelOpts);
|
||||
|
||||
// --------------- css -----------
|
||||
createCssWebpackConfig({
|
||||
const createCSSRule = createCssWebpackConfig({
|
||||
isDev,
|
||||
config,
|
||||
webpackConfig,
|
||||
@ -306,12 +306,14 @@ export default async function getConfig({
|
||||
// --------------- chainwebpack -----------
|
||||
if (chainWebpack) {
|
||||
await chainWebpack(webpackConfig, {
|
||||
createCSSRule,
|
||||
webpack
|
||||
});
|
||||
}
|
||||
// 用户配置的 chainWebpack 优先级最高
|
||||
if (config.chainWebpack) {
|
||||
await config.chainWebpack(webpackConfig, {
|
||||
createCSSRule,
|
||||
env,
|
||||
webpack
|
||||
});
|
||||
|
@ -9,7 +9,11 @@ export default (api) => {
|
||||
const { absSrcPath = '', absTmpPath = '' } = paths;
|
||||
const files = [
|
||||
'global.css',
|
||||
'global.less'
|
||||
'global.less',
|
||||
'global.scss',
|
||||
'global.sass',
|
||||
'global.styl',
|
||||
'global.stylus'
|
||||
];
|
||||
const globalCSSFile = files
|
||||
.map(file => join(absSrcPath || '', file))
|
||||
|
@ -56,6 +56,7 @@
|
||||
"@fesjs/plugin-vuex": "^2.0.0-rc.0",
|
||||
"@fesjs/plugin-request": "^2.0.0-rc.0",
|
||||
"@fesjs/plugin-qiankun": "^2.0.0-rc.0",
|
||||
"@fesjs/plugin-sass": "^2.0.0-rc.0",
|
||||
"ant-design-vue": "2.0.0",
|
||||
"vue": "^3.0.5",
|
||||
"vuex": "^4.0.0"
|
||||
|
5
packages/fes-template/src/global.scss
Normal file
5
packages/fes-template/src/global.scss
Normal file
@ -0,0 +1,5 @@
|
||||
html {
|
||||
body {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
45
yarn.lock
45
yarn.lock
@ -5868,6 +5868,21 @@ chokidar@3.4.2:
|
||||
optionalDependencies:
|
||||
fsevents "~2.1.2"
|
||||
|
||||
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.0.2, chokidar@^3.4.3, chokidar@^3.5.1:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
|
||||
integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==
|
||||
dependencies:
|
||||
anymatch "~3.1.1"
|
||||
braces "~3.0.2"
|
||||
glob-parent "~5.1.0"
|
||||
is-binary-path "~2.1.0"
|
||||
is-glob "~4.0.1"
|
||||
normalize-path "~3.0.0"
|
||||
readdirp "~3.5.0"
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.1"
|
||||
|
||||
chokidar@^2.1.8:
|
||||
version "2.1.8"
|
||||
resolved "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917"
|
||||
@ -5887,21 +5902,6 @@ chokidar@^2.1.8:
|
||||
optionalDependencies:
|
||||
fsevents "^1.2.7"
|
||||
|
||||
chokidar@^3.0.2, chokidar@^3.4.3, chokidar@^3.5.1:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
|
||||
integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==
|
||||
dependencies:
|
||||
anymatch "~3.1.1"
|
||||
braces "~3.0.2"
|
||||
glob-parent "~5.1.0"
|
||||
is-binary-path "~2.1.0"
|
||||
is-glob "~4.0.1"
|
||||
normalize-path "~3.0.0"
|
||||
readdirp "~3.5.0"
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.1"
|
||||
|
||||
chownr@^1.1.1, chownr@^1.1.2:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
|
||||
@ -14553,6 +14553,21 @@ sane@^4.0.3:
|
||||
minimist "^1.1.1"
|
||||
walker "~1.0.5"
|
||||
|
||||
sass-loader@^11.0.1:
|
||||
version "11.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-11.0.1.tgz#8672f896593466573b904f47693e0695368e38c9"
|
||||
integrity sha512-Vp1LcP4slTsTNLEiDkTcm8zGN/XYYrZz2BZybQbliWA8eXveqA/AxsEjllQTpJbg2MzCsx/qNO48sHdZtOaxTw==
|
||||
dependencies:
|
||||
klona "^2.0.4"
|
||||
neo-async "^2.6.2"
|
||||
|
||||
sass@^1.32.11:
|
||||
version "1.32.11"
|
||||
resolved "https://registry.yarnpkg.com/sass/-/sass-1.32.11.tgz#b236b3ea55c76602c2ef2bd0445f0db581baa218"
|
||||
integrity sha512-O9tRcob/fegUVSIV1ihLLZcftIOh0AF1VpKgusUfLqnb2jQ0GLDwI5ivv1FYWivGv8eZ/AwntTyTzjcHu0c/qw==
|
||||
dependencies:
|
||||
chokidar ">=3.0.0 <4.0.0"
|
||||
|
||||
sax@~1.2.4:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
|
||||
|
Loading…
Reference in New Issue
Block a user