Skip to content

Commit d07b330

Browse files
committed
1.1.7
1 parent 27c5573 commit d07b330

26 files changed

+3966
-30205
lines changed

.browserslistrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
current node
2+
last 2 versions and > 2%
3+
ie > 10

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,15 @@ If you need to filter a column, you can use the `v-filter-column` directive.
158158
</template>
159159
160160
<script>
161-
import VueTable from "../src/components/VueTable";
162-
import { filterColumn } from "../src/directives/filter-column.directive";
161+
import { filterColumn, VueTable } from '@kriptiko/vue-table';
163162
164163
export default {
165164
components: {
166165
VueTable
167166
},
168-
directives: { filterColumn }
167+
directives: {
168+
filterColumn
169+
}
169170
}
170171
</sc
171172
```

babel.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
presets: [
3-
'@vue/cli-plugin-babel/preset'
4-
]
5-
}
2+
presets: [
3+
'@babel/preset-env',
4+
],
5+
};

build/rollup.config.js

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
// rollup.config.js
2+
import fs from 'fs';
3+
import path from 'path';
4+
import vue from 'rollup-plugin-vue';
5+
import alias from '@rollup/plugin-alias';
6+
import commonjs from '@rollup/plugin-commonjs';
7+
import replace from '@rollup/plugin-replace';
8+
import babel from 'rollup-plugin-babel';
9+
import { terser } from 'rollup-plugin-terser';
10+
import minimist from 'minimist';
11+
12+
// Get browserslist config and remove ie from es build targets
13+
const esbrowserslist = fs.readFileSync('./.browserslistrc')
14+
.toString()
15+
.split('\n')
16+
.filter((entry) => entry && entry.substring(0, 2) !== 'ie');
17+
18+
const argv = minimist(process.argv.slice(2));
19+
20+
const projectRoot = path.resolve(__dirname, '..');
21+
22+
const baseConfig = {
23+
input: 'src/entry.js',
24+
plugins: {
25+
preVue: [
26+
alias({
27+
resolve: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
28+
entries: {
29+
'@': path.resolve(projectRoot, 'src'),
30+
},
31+
}),
32+
],
33+
replace: {
34+
'process.env.NODE_ENV': JSON.stringify('production'),
35+
'process.env.ES_BUILD': JSON.stringify('false'),
36+
},
37+
vue: {
38+
css: true,
39+
template: {
40+
isProduction: true,
41+
},
42+
},
43+
babel: {
44+
exclude: 'node_modules/**',
45+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
46+
},
47+
},
48+
};
49+
50+
// ESM/UMD/IIFE shared settings: externals
51+
// Refer to https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
52+
const external = [
53+
'axios',
54+
'qs',
55+
'vue',
56+
'vuedraggable',
57+
'vuex'
58+
];
59+
60+
// UMD/IIFE shared settings: output.globals
61+
// Refer to https://rollupjs.org/guide/en#output-globals for details
62+
const globals = {
63+
axios: 'axios',
64+
qs: 'qs',
65+
vue: 'Vue',
66+
vuedraggable: 'VueDraggable',
67+
vuex: 'vuex'
68+
};
69+
70+
// Customize configs for individual targets
71+
const buildFormats = [];
72+
if (!argv.format || argv.format === 'es') {
73+
const esConfig = {
74+
...baseConfig,
75+
external,
76+
output: {
77+
file: 'dist/vue-table.esm.js',
78+
format: 'esm',
79+
exports: 'named',
80+
},
81+
plugins: [
82+
replace({
83+
...baseConfig.plugins.replace,
84+
'process.env.ES_BUILD': JSON.stringify('true'),
85+
}),
86+
...baseConfig.plugins.preVue,
87+
vue(baseConfig.plugins.vue),
88+
babel({
89+
...baseConfig.plugins.babel,
90+
presets: [
91+
[
92+
'@babel/preset-env',
93+
{
94+
targets: esbrowserslist,
95+
},
96+
],
97+
],
98+
}),
99+
commonjs(),
100+
],
101+
};
102+
buildFormats.push(esConfig);
103+
}
104+
105+
if (!argv.format || argv.format === 'cjs') {
106+
const umdConfig = {
107+
...baseConfig,
108+
external,
109+
output: {
110+
compact: true,
111+
file: 'dist/vue-table.ssr.js',
112+
format: 'cjs',
113+
name: 'VueTable',
114+
exports: 'named',
115+
globals,
116+
},
117+
plugins: [
118+
replace(baseConfig.plugins.replace),
119+
...baseConfig.plugins.preVue,
120+
vue({
121+
...baseConfig.plugins.vue,
122+
template: {
123+
...baseConfig.plugins.vue.template,
124+
optimizeSSR: true,
125+
},
126+
}),
127+
babel(baseConfig.plugins.babel),
128+
commonjs(),
129+
],
130+
};
131+
buildFormats.push(umdConfig);
132+
}
133+
134+
if (!argv.format || argv.format === 'iife') {
135+
const unpkgConfig = {
136+
...baseConfig,
137+
external,
138+
output: {
139+
compact: true,
140+
file: 'dist/vue-table.min.js',
141+
format: 'iife',
142+
name: 'VueTable',
143+
exports: 'named',
144+
globals,
145+
},
146+
plugins: [
147+
replace(baseConfig.plugins.replace),
148+
...baseConfig.plugins.preVue,
149+
vue(baseConfig.plugins.vue),
150+
babel(baseConfig.plugins.babel),
151+
commonjs(),
152+
terser({
153+
output: {
154+
ecma: 5,
155+
},
156+
}),
157+
],
158+
};
159+
buildFormats.push(unpkgConfig);
160+
}
161+
162+
// Export config
163+
export default buildFormats;

dev/App.vue

+2-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<script>
3434
import VueTable from "../src/components/VueTable";
35-
import { filterColumn } from "../src/directives/filter-column.directive";
35+
import filterColumn from "../src/directives/filter-column.directive";
3636
3737
export default {
3838
name: 'App',
@@ -77,12 +77,8 @@
7777
],
7878
sorting: [
7979
{
80-
column: "name",
80+
column: "created_at",
8181
direction: "desc"
82-
},
83-
{
84-
column: "email",
85-
direction: "asc"
8682
}
8783
],
8884
actions: {

dev/app.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import Vue from 'vue';
22
import App from './App.vue';
3-
import store from '../src/store';
3+
import 'bootstrap/scss/bootstrap.scss';
44

55
Vue.config.productionTip = false;
66

77
new Vue({
8-
store,
98
render: h => h(App),
109
}).$mount('#app');

dist/demo.html

-10
This file was deleted.

0 commit comments

Comments
 (0)