Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit c2beb86

Browse files
author
Runyasak Chaengnaimuang
authored
Merge pull request #38 from Sitronik/next
Next
2 parents de0c930 + 6dbcc7b commit c2beb86

File tree

7 files changed

+11705
-5279
lines changed

7 files changed

+11705
-5279
lines changed

example/App.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
<VueElementLoading :active="pikachu">
3535
<img
3636
src="https://i.pinimg.com/originals/9f/b1/25/9fb125f1fedc8cc62ab5b20699ebd87d.gif"
37-
width="55px"
38-
height="55px"
37+
width="55"
38+
height="55"
3939
>
4040
</VueElementLoading>
4141
<span>
@@ -116,8 +116,7 @@
116116
</template>
117117

118118
<script>
119-
// import VueElementLoading from '../src'
120-
import VueElementLoading from '../lib/vue-element-loading.min.js'
119+
import VueElementLoading from '../src/index.vue';
121120
122121
export default {
123122
name: 'app',

example/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import Vue from 'vue'
1+
import * as Vue from 'vue';
22
import App from './App.vue'
33

4-
new Vue({
5-
el: '#app',
6-
render: function (h) { return h(App) }
7-
})
4+
const app = Vue.createApp(App);
5+
app.mount('#app');

package-lock.json

Lines changed: 11600 additions & 5177 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,45 @@
11
{
22
"name": "vue-element-loading",
33
"description": "Loading inside a container or full screen for Vue.js",
4-
"version": "1.1.6",
4+
"version": "2.0.0",
55
"author": "biig_pongsatorn <biig_pongsatorn@hotmail.com>",
66
"license": "MIT",
7-
"main": "lib/vue-element-loading.min.js",
7+
"main": "dist/VueElementLoading.common.js",
88
"files": [
9-
"lib"
9+
"dist"
1010
],
1111
"repository": {
1212
"type": "git",
1313
"url": "git+https://github.com/biigpongsatorn/vue-element-loading.git"
1414
},
1515
"scripts": {
1616
"dev": "cross-env NODE_ENV=development webpack-dev-server --mode development --open --hot",
17-
"build:lib": "rm -rf ./lib && bili src/index.vue",
17+
"build": "npx vue-cli-service build --target lib --name VueElementLoading ./src/index.js --mode production",
18+
"build:lib": "npx vue-cli-service build --target lib --name VueElementLoading ./src/index.js --mode production",
1819
"build:example": "rm -rf ./dist && cross-env NODE_ENV=production webpack --mode production --progress --hide-modules",
19-
"prepublish": "npm run build:lib"
20-
},
21-
"dependencies": {
22-
"vue": "^2.5.22"
20+
"prepublish": "npm run build"
2321
},
22+
"dependencies": {},
2423
"browserslist": [
2524
"> 1%",
2625
"last 2 versions",
2726
"not ie <= 8"
2827
],
2928
"devDependencies": {
29+
"acorn": "^8.0.4",
3030
"@babel/core": "^7.2.2",
3131
"@babel/preset-env": "^7.2.3",
3232
"babel-loader": "^8.0.5",
3333
"bili": "^3.4.2",
3434
"cross-env": "^5.2.0",
3535
"css-loader": "^2.1.0",
3636
"file-loader": "^3.0.1",
37-
"rollup-plugin-vue": "^4.6.1",
37+
"rollup-plugin-vue": "^6.0.0",
3838
"uglifyjs-webpack-plugin": "^2.1.1",
39-
"vue-loader": "^15.5.1",
40-
"vue-template-compiler": "^2.5.22",
39+
"vue": "^3.0.5",
40+
"@vue/compiler-sfc": "^3.0.0",
41+
"@vue/cli-service": "^4.5.6",
42+
"vue-loader": "16.1.2",
4143
"webpack": "^4.28.4",
4244
"webpack-cli": "^3.2.1",
4345
"webpack-dev-server": ">=3.1.11"

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import VueElementLoading from './index.vue'
2+
3+
export default VueElementLoading

vue.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
css: { extract: false }
3+
}

webpack.config.js

Lines changed: 80 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,90 @@
11
const path = require('path');
22
const webpack = require('webpack');
33
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
4-
const VueLoaderPlugin = require('vue-loader/lib/plugin');
4+
const {VueLoaderPlugin} = require('vue-loader');
55

6-
module.exports = {
7-
entry: './example/main.js',
8-
output: {
9-
path: path.resolve(__dirname, './dist'),
10-
publicPath: '/dist',
11-
filename: 'build.js'
12-
},
13-
module: {
14-
rules: [
15-
{
16-
test: /\.css$/,
17-
use: [
18-
'vue-style-loader',
19-
'css-loader'
20-
],
21-
},
22-
{
23-
test: /\.vue$/,
24-
loader: 'vue-loader',
25-
options: {
26-
loaders: {
6+
module.exports = (env, args) => {
7+
const isDev = args && args.mode === 'development';
8+
9+
return {
10+
entry: './example/main.js',
11+
output: {
12+
path: path.resolve(__dirname, './dist'),
13+
publicPath: '/dist',
14+
filename: isDev ? 'build.js' : 'vue-element-loading.min.js'
15+
},
16+
module: {
17+
rules: [
18+
{
19+
test: /\.css$/,
20+
use: [
21+
'vue-style-loader',
22+
'css-loader'
23+
],
24+
},
25+
{
26+
test: /\.vue$/,
27+
loader: 'vue-loader',
28+
options: {
29+
loaders: {}
30+
// other vue-loader options go here
31+
}
32+
},
33+
{
34+
test: /\.js$/,
35+
loader: 'babel-loader',
36+
exclude: /node_modules/
37+
},
38+
{
39+
test: /\.(png|jpg|gif|svg)$/,
40+
loader: 'file-loader',
41+
options: {
42+
name: '[name].[ext]?[hash]'
2743
}
28-
// other vue-loader options go here
2944
}
45+
]
46+
},
47+
resolve: {
48+
alias: {
49+
'vue$': 'vue/dist/vue.esm-bundler.js'
3050
},
31-
{
32-
test: /\.js$/,
33-
loader: 'babel-loader',
34-
exclude: /node_modules/
35-
},
36-
{
37-
test: /\.(png|jpg|gif|svg)$/,
38-
loader: 'file-loader',
39-
options: {
40-
name: '[name].[ext]?[hash]'
41-
}
42-
}
43-
]
44-
},
45-
resolve: {
46-
alias: {
47-
'vue$': 'vue/dist/vue.esm.js'
51+
extensions: ['*', '.js', '.vue', '.json']
4852
},
49-
extensions: ['*', '.js', '.vue', '.json']
50-
},
51-
optimization: {
52-
minimizer: [
53-
new UglifyJsPlugin({
54-
sourceMap: true,
55-
parallel: 4,
56-
uglifyOptions: {
57-
warnings: false,
58-
compress: {
59-
warnings: false
60-
},
61-
},
62-
})
63-
]
64-
},
65-
plugins: [
66-
new VueLoaderPlugin(),
67-
],
68-
devServer: {
69-
historyApiFallback: true,
70-
noInfo: true,
71-
overlay: true
72-
},
73-
performance: {
74-
hints: false
75-
},
76-
devtool: '#eval-source-map'
77-
};
53+
optimization: {
54+
minimizer: [
55+
new UglifyJsPlugin({
56+
sourceMap: true,
57+
parallel: 4,
58+
uglifyOptions: {},
59+
})
60+
]
61+
},
62+
plugins: [
63+
new VueLoaderPlugin(),
64+
],
65+
devServer: {
66+
historyApiFallback: true,
67+
noInfo: true,
68+
overlay: true
69+
},
70+
performance: {
71+
hints: false
72+
},
73+
devtool: '#eval-source-map'
74+
};
7875

79-
if (process.env.NODE_ENV === 'production') {
80-
module.exports.devtool = '#source-map';
81-
// http://vue-loader.vuejs.org/en/workflow/production.html
82-
module.exports.plugins = (module.exports.plugins || []).concat([
83-
new webpack.DefinePlugin({
84-
'process.env': {
85-
NODE_ENV: '"production"'
86-
}
87-
}),
88-
new webpack.LoaderOptionsPlugin({
89-
minimize: true
90-
})
91-
]);
76+
if (process.env.NODE_ENV === 'production') {
77+
module.exports.devtool = '#source-map';
78+
// http://vue-loader.vuejs.org/en/workflow/production.html
79+
module.exports.plugins = (module.exports.plugins || []).concat([
80+
new webpack.DefinePlugin({
81+
'process.env': {
82+
NODE_ENV: '"production"'
83+
}
84+
}),
85+
new webpack.LoaderOptionsPlugin({
86+
minimize: true
87+
})
88+
]);
89+
}
9290
}

0 commit comments

Comments
 (0)