workflow-editor 0.9.85-dw → 0.9.85-dw-tmp1

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/.babelrc ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "loose": false,
7
+ "modules": "commonjs",
8
+ "spec": true,
9
+ "useBuiltIns": "usage",
10
+ "corejs": "2.6.9"
11
+ }
12
+ ]
13
+ ],
14
+ "plugins": [
15
+ "@babel/plugin-transform-runtime",
16
+ ["component", {
17
+ "libraryName": "workflow-editor",
18
+ "libDir": "lib",
19
+ "styleLibrary": {
20
+ "name": "styles",
21
+ "base": false, // no base.css file
22
+ "path": "[module].css"
23
+ }
24
+ }]
25
+ ]
26
+ }
27
+
28
+ // {
29
+ // "plugins": [
30
+ // ["component", {
31
+ // "libraryName": "imatrix-ui",
32
+ // "libDir": "lib",
33
+ // "styleLibrary": {
34
+ // "name": "styles",
35
+ // "base": false, // no base.css file
36
+ // "path": "[module].css"
37
+ // }
38
+ // }]
39
+ // ]
40
+ // }
@@ -0,0 +1,3 @@
1
+ {
2
+ "workflow-editor": "packages/workflow-editor/index.js"
3
+ }
@@ -0,0 +1,32 @@
1
+ const gulp = require('gulp');
2
+ const cleanCSS = require('gulp-clean-css');
3
+ const sass = require('gulp-sass');
4
+ const rename = require('gulp-rename');
5
+ const autoprefixer = require('gulp-autoprefixer');
6
+ const components = require('./components.json')
7
+
8
+ function buildCss(cb) {
9
+ gulp.src('../src/styles/index.scss')
10
+ .pipe(sass())
11
+ .pipe(autoprefixer())
12
+ .pipe(cleanCSS())
13
+ .pipe(rename('lime-ui.css'))
14
+ .pipe(gulp.dest('../lib/styles'));
15
+ cb()
16
+ }
17
+
18
+
19
+ function buildSeperateCss(cb) {
20
+ Object.keys(components).forEach(compName => {
21
+ gulp.src(`../src/styles/${compName}.scss`)
22
+ .pipe(sass())
23
+ .pipe(autoprefixer())
24
+ .pipe(cleanCSS())
25
+ .pipe(rename(`${compName}.css`))
26
+ .pipe(gulp.dest('../lib/styles'));
27
+ })
28
+
29
+ cb()
30
+ }
31
+
32
+ exports.default = gulp.series(buildCss, buildSeperateCss) // 加上 buildSeperateCss
@@ -0,0 +1,140 @@
1
+ const path = require('path');
2
+ const webpack = require('webpack');
3
+ const pkg = require('../package.json');
4
+ const VueLoaderPlugin = require('vue-loader/lib/plugin')
5
+
6
+ function resolve(dir) {
7
+ return path.join(__dirname, '..', dir);
8
+ }
9
+
10
+ module.exports = {
11
+ module: {
12
+ rules: [
13
+ {
14
+ test: /\.vue$/,
15
+ loader: 'vue-loader',
16
+ options: {
17
+ loaders: {
18
+ css: [
19
+ 'vue-style-loader',
20
+ {
21
+ loader: 'css-loader',
22
+ options: {
23
+ sourceMap: true,
24
+ },
25
+ },
26
+ ],
27
+ less: [
28
+ 'vue-style-loader',
29
+ {
30
+ loader: 'css-loader',
31
+ options: {
32
+ sourceMap: true,
33
+ },
34
+ },
35
+ {
36
+ loader: 'less-loader',
37
+ options: {
38
+ sourceMap: true,
39
+ },
40
+ },
41
+ ],
42
+ },
43
+ postLoaders: {
44
+ html: 'babel-loader?sourceMap'
45
+ },
46
+ sourceMap: true,
47
+ }
48
+ },
49
+ {
50
+ test: /\.js$/,
51
+ loader: 'babel-loader',
52
+ options: {
53
+ sourceMap: true,
54
+ },
55
+ exclude: /node_modules/,
56
+ },
57
+ {
58
+ test: /\.css$/,
59
+ loaders: [
60
+ {
61
+ loader: 'style-loader',
62
+ options: {
63
+ sourceMap: true,
64
+ },
65
+ },
66
+ {
67
+ loader: 'css-loader',
68
+ options: {
69
+ sourceMap: true,
70
+ },
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ test: /\.less$/,
76
+ loaders: [
77
+ {
78
+ loader: 'style-loader',
79
+ options: {
80
+ sourceMap: true,
81
+ },
82
+ },
83
+ {
84
+ loader: 'css-loader',
85
+ options: {
86
+ sourceMap: true,
87
+ },
88
+ },
89
+ {
90
+ loader: 'less-loader',
91
+ options: {
92
+ sourceMap: true,
93
+ },
94
+ },
95
+ ]
96
+ },
97
+ {
98
+ test: /\.scss$/,
99
+ loaders: [
100
+ {
101
+ loader: 'style-loader',
102
+ options: {
103
+ sourceMap: true,
104
+ },
105
+ },
106
+ {
107
+ loader: 'css-loader',
108
+ options: {
109
+ sourceMap: true,
110
+ },
111
+ },
112
+ {
113
+ loader: 'sass-loader',
114
+ options: {
115
+ sourceMap: true,
116
+ },
117
+ },
118
+ ]
119
+ },
120
+ {
121
+ test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/,
122
+ loader: 'url-loader?limit=8192'
123
+ }
124
+ ]
125
+ },
126
+ resolve: {
127
+ extensions: ['.js', '.vue'],
128
+ alias: {
129
+ 'vue': 'vue/dist/vue.esm.js',
130
+ '@': resolve('src')
131
+ }
132
+ },
133
+ plugins: [
134
+ new webpack.optimize.ModuleConcatenationPlugin(),
135
+ new webpack.DefinePlugin({
136
+ 'process.env.VERSION': `'${pkg.version}'`
137
+ }),
138
+ new VueLoaderPlugin()
139
+ ]
140
+ }
@@ -0,0 +1,40 @@
1
+ const path = require('path');
2
+ const webpack = require('webpack');
3
+ const merge = require('webpack-merge');
4
+ const webpackBaseConfig = require('./webpack.base.js');
5
+ const components = require('./components.json')
6
+ process.env.NODE_ENV = 'production';
7
+
8
+ const basePath = path.resolve(__dirname, '../')
9
+ let entries = {}
10
+ Object.keys(components).forEach(key => {
11
+ entries[key] = path.join(basePath, '.', components[key])
12
+ })
13
+
14
+ module.exports = merge(webpackBaseConfig, {
15
+ devtool: 'source-map',
16
+ mode: "production",
17
+ entry: entries,
18
+ output: {
19
+ path: path.resolve(__dirname, '../lib'),
20
+ publicPath: '/lib/',
21
+ filename: '[name].js',
22
+ chunkFilename: '[id].js',
23
+ // library: 'lime-ui',
24
+ libraryTarget: 'umd',
25
+ umdNamedDefine: true
26
+ },
27
+ externals: {
28
+ vue: {
29
+ root: 'Vue',
30
+ commonjs: 'vue',
31
+ commonjs2: 'vue',
32
+ amd: 'vue'
33
+ }
34
+ },
35
+ plugins: [
36
+ new webpack.DefinePlugin({
37
+ 'process.env.NODE_ENV': '"production"'
38
+ })
39
+ ]
40
+ });
@@ -0,0 +1,35 @@
1
+ const path = require('path');
2
+ const webpack = require('webpack');
3
+ const merge = require('webpack-merge');
4
+ const webpackBaseConfig = require('./webpack.base.js');
5
+
6
+ process.env.NODE_ENV = 'production';
7
+
8
+ module.exports = merge(webpackBaseConfig, {
9
+ devtool: 'source-map',
10
+ mode: "production",
11
+ entry: {
12
+ main: path.resolve(__dirname, '../src/index.js') // 将src下的index.js 作为入口点
13
+ },
14
+ output: {
15
+ path: path.resolve(__dirname, '../lib'),
16
+ publicPath: '/lib/',
17
+ filename: 'workflow-editor.min.js', // 改成自己的类库名
18
+ library: 'workflow-editor', // 类库导出
19
+ libraryTarget: 'umd',
20
+ umdNamedDefine: true
21
+ },
22
+ externals: { // 外部化对vue的依赖
23
+ vue: {
24
+ root: 'Vue',
25
+ commonjs: 'vue',
26
+ commonjs2: 'vue',
27
+ amd: 'vue'
28
+ }
29
+ },
30
+ plugins: [
31
+ new webpack.DefinePlugin({
32
+ 'process.env.NODE_ENV': '"production"'
33
+ })
34
+ ]
35
+ })