chart-services 2.2.1 → 2.3.1

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,13 +1,18 @@
1
1
  {
2
2
  "name": "chart-services",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "",
5
5
  "types": "types/index.d.ts",
6
- "main": "dist/chart-services.js",
6
+ "main": "dist/src/index.js",
7
+ "exports": {
8
+ ".": "./dist/src/index.js"
9
+ },
7
10
  "scripts": {
8
11
  "install-npx-link-dep": "npx link ../ee-library ../cboard-chart ../cboard-common",
9
12
  "rollup-build:dev": "rollup -c rollup.config.js --environment mode:development",
10
13
  "rollup-build:prod": "rollup -c rollup.config.js --environment mode:production",
14
+ "webpack-build:dev": "webpack --env development",
15
+ "webpack-build:prod": "webpack --env production",
11
16
  "run-publish": "npm run rollup-build:prod && npm publish"
12
17
  },
13
18
  "keywords": [],
@@ -35,10 +40,10 @@
35
40
  "@rollup/plugin-terser": "^0.4.4",
36
41
  "@rollup/plugin-typescript": "^11.1.6",
37
42
  "babel-loader": "^8.2.5",
38
- "cboard-chart": "~2.2.0",
39
- "cboard-common": "~2.2.0",
43
+ "cboard-chart": "~2.3.0",
44
+ "cboard-common": "~2.3.0",
40
45
  "css-loader": "^5.2.7",
41
- "ee-library": "~2.2.0",
46
+ "ee-library": "~2.3.0",
42
47
  "eslint": "^3.9.1",
43
48
  "eslint-loader": "^1.6.1",
44
49
  "jquery": "^3.3.1",
package/rollup.config.js CHANGED
@@ -34,15 +34,29 @@ const externals = [
34
34
  'cboard-earth',
35
35
  ];
36
36
 
37
+ const prdOutput = {
38
+ file: './dist/src/index.js',
39
+ format: 'umd',
40
+ };
41
+
42
+ const devOutput = {
43
+ dir: './dist',
44
+ format: 'esm',
45
+ preserveModules: true,
46
+ }
47
+
37
48
  export default commandLineArgs => {
38
49
  const isProduction = process.env.mode === 'production';
39
50
  console.log('isProduction', isProduction)
51
+ const output = isProduction ? prdOutput : devOutput;
40
52
 
41
53
  return {
42
54
  input: './src/index.js',
43
55
  output: {
44
- file: './dist/chart-services.js',
45
- format: 'umd',
56
+ dir: './dist',
57
+ format: isProduction ? 'umd' : 'esm',
58
+ preserveModules: !isProduction,
59
+ entryFileNames: !isProduction ? undefined : 'src/index.js', // 保持原 main 指向不变
46
60
  name: 'chart-services',
47
61
  sourcemap: !isProduction, // Enable sourcemap only in development mode
48
62
  globals: {
@@ -85,7 +99,7 @@ export default commandLineArgs => {
85
99
  presets: ['@babel/preset-env'],
86
100
  }),
87
101
  postcss({
88
- extract: true,
102
+ extract: 'chart-services.css', // ⭐ 输出为 dist/chart-services.css
89
103
  minimize: isProduction,
90
104
  use: [
91
105
  ['less', { javascriptEnabled: true }]