akfun 3.2.8 → 3.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akfun",
3
- "version": "3.2.8",
3
+ "version": "3.2.9",
4
4
  "description": "前端脚手架:支持Vue技术栈和react技术栈",
5
5
  "keywords": [
6
6
  "前端工程",
@@ -133,6 +133,10 @@
133
133
  "rollup-plugin-vue": "^6.0.0",
134
134
  "sass": "^1.49.7",
135
135
  "sass-loader": "^12.4.0",
136
+ "less": "^4.1.3",
137
+ "less-loader": "^11.0.0",
138
+ "stylus": "^0.57.0",
139
+ "stylus-loader": "^7.0.0",
136
140
  "sass-resources-loader": "^2.2.4",
137
141
  "semver": "^7.3.5",
138
142
  "shelljs": "^0.8.5",
@@ -69,7 +69,7 @@ module.exports = function (fileName, akfunConfig) {
69
69
  postcss({
70
70
  extensions: ['.css', '.scss', '.sass', '.styl', '.stylus', '.less'],
71
71
  // Or with custom file name, it will generate file relative to bundle.js in v3
72
- extract: resolveToCurrentDist(`${curFileName}.css`),
72
+ extract: resolveToCurrentDist(`${curFileName}.css`, build2esm.outDir),
73
73
  plugins: [
74
74
  simplevars(),
75
75
  nested(),
@@ -83,11 +83,11 @@ module.exports = function (fileName, akfunConfig) {
83
83
  ],
84
84
  output: [
85
85
  {
86
- file: resolveToCurrentDist(`${curFileName}.esm.js`),
86
+ file: resolveToCurrentDist(`${curFileName}.esm.js`, build2esm.outDir),
87
87
  format: 'esm'
88
88
  },
89
89
  {
90
- file: resolveToCurrentDist(`${curFileName}.esm.min.js`),
90
+ file: resolveToCurrentDist(`${curFileName}.esm.min.js`, build2esm.outDir),
91
91
  format: 'esm',
92
92
  plugins: [terser()]
93
93
  }
@@ -4,7 +4,8 @@ const fs = require('fs');
4
4
  // 当前命令执行的路径
5
5
  const currentRoot = () => fs.realpathSync(process.cwd());
6
6
  const resolveToCurrentRoot = (filePath) => path.resolve(currentRoot(), filePath);
7
- const resolveToCurrentDist = (filePath) => path.resolve(currentRoot(), 'dist/', filePath);
7
+ const resolveToCurrentDist = (filePath, outDir) =>
8
+ path.resolve(currentRoot(), outDir || 'dist/', filePath);
8
9
  const currentSrc = () => resolveToCurrentRoot('src');
9
10
  const currentBuild = () => resolveToCurrentRoot('build');
10
11
  // 获取当前项目的package文件(从当前命令执行的路径下查找)
@@ -23,7 +23,7 @@ module.exports = (akfunConfig) => {
23
23
  publicPath: '',
24
24
  library: {
25
25
  type: 'umd', // 定义打包方式Universal Module Definition,同时支持在CommonJS、AMD和全局变量使用
26
- name: curEnvConfig.libraryName
26
+ name: curEnvConfig.libraryName || '[name]'
27
27
  },
28
28
  // 指定类库名,主要用于直接引用的方式(比如使用script 标签)
29
29
  globalObject: 'this' // 定义全局变量,兼容node和浏览器运行,避免出现"window is not defined"的情况