Merge pull request #37 from QingWei-Li/master

Update config, default require commonjs package
This commit is contained in:
杨奕 2016-09-09 10:45:39 +08:00 committed by GitHub
commit c30003d444
6 changed files with 48 additions and 31 deletions

View File

@ -10,9 +10,10 @@
- 修复 Table 中被固定列的高度不与其他列的高度协调的问题
- 修复 Time Picker 的 `picker-options` 属性
- 修复一些组件图标丢失的问题
- 修复远程搜索的 Select 在 Form 中的显示问题
- 修复 远程搜索的 Select 在 Form 中的显示问题
- 修复 Input Number 输入小数和非数字值时的问题
- 修复 Select 选中 value 为 0 的值时绑定值不更新的问题
- 优化 增加打包成 commonjs 且不压缩的文件,默认引入 commonjs
#### 非兼容性更新
- Menu 组件 `mode` 属性默认值修改为 `vertical`

View File

@ -2,14 +2,14 @@
"name": "element-ui",
"version": "1.0.0-rc.1",
"description": "A Component Library for Vue.js.",
"main": "lib/index.js",
"main": "lib/element-ui.common.js",
"files": [
"lib",
"src"
],
"scripts": {
"dev": "npm i && (node bin/iconInit.js & node bin/build-entry.js) && cooking watch -c scripts/cooking.demo.js",
"dist": "del -f lib && cooking build -c scripts/cooking.conf.js -p && cooking build -c scripts/cooking.component.js -p && npm run build:theme",
"dist": "del -f lib && cooking build -c scripts/cooking.conf.js,scripts/cooking.common.js -p && cooking build -c scripts/cooking.component.js -p && npm run build:theme",
"dist:all": "node bin/build-all.js && npm run build:theme",
"build:theme": "gulp build --gulpfile packages/theme-default/gulpfile.js && cp-cli packages/theme-default/lib lib/theme-default",
"deploy": "cooking build -c scripts/cooking.demo.js -p",

View File

@ -43,9 +43,9 @@
}
},
width: String,
width: [String, Number],
height: String,
height: [String, Number],
fit: {
type: Boolean,

21
scripts/cooking.common.js Normal file
View File

@ -0,0 +1,21 @@
var cooking = require('cooking');
var path = require('path');
cooking.set({
entry: './src/index.js',
dist: './lib',
clean: false,
format: 'cjs',
extends: ['vue2'],
minimize: false,
alias: {
main: path.join(__dirname, '../src'),
packages: path.join(__dirname, '../packages'),
examples: path.join(__dirname, '../examples')
},
externals: { vue: 'vue' }
});
cooking.add('output.filename', 'element-ui.common.js');
cooking.add('loader.js.exclude', /node_modules|utils\/popper\.js|util\/fecha.\js/);
module.exports = cooking.resolve();

View File

@ -15,18 +15,17 @@ cooking.set({
dist: './lib',
clean: false,
format: 'cjs',
extractCSS: '[name]/style.css',
extends: ['vue2']
extends: ['vue2'],
minimize: false,
alias: {
main: path.join(__dirname, '../src'),
packages: path.join(__dirname, '../packages'),
examples: path.join(__dirname, '../examples')
}
});
cooking.add('output.filename', '[name]/index.js');
cooking.add('resolve.alias', {
'main': path.join(__dirname, '../src'),
'packages': path.join(__dirname, '../packages'),
'examples': path.join(__dirname, '../examples')
});
var externals = {};
Object.keys(Components).forEach(function(key) {
externals[`packages/${key}/index.js`] = `element-ui/lib/${key}`;
@ -46,5 +45,4 @@ cooking.add('externals', Object.assign({
}, externals));
cooking.add('loader.js.exclude', /node_modules|utils\/popper\.js|util\/fecha.\js/);
module.exports = cooking.resolve();

View File

@ -7,25 +7,22 @@ cooking.set({
clean: false,
format: 'umd',
moduleName: 'ELEMENT',
extractCSS: 'style.css',
extends: ['vue2']
extends: ['vue2'],
alias: {
main: path.join(__dirname, '../src'),
packages: path.join(__dirname, '../packages'),
examples: path.join(__dirname, '../examples')
},
externals: {
vue: {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
}
}
});
cooking.add('output.filename', 'index.js');
cooking.add('resolve.alias', {
'main': path.join(__dirname, '../src'),
'packages': path.join(__dirname, '../packages'),
'examples': path.join(__dirname, '../examples')
});
cooking.add('externals.vue', {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
});
cooking.add('loader.js.exclude', /node_modules|utils\/popper\.js|util\/fecha.\js/);
module.exports = cooking.resolve();