Skip to content

Commit e599d21

Browse files
committed
Optimize plugin.
1 parent f2b6e4d commit e599d21

File tree

9 files changed

+21
-190
lines changed

9 files changed

+21
-190
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vuejs Dialog Plugin
22

3-
> A robost, promise based alert and confirm dialog.
3+
> A robost, lightweight, promise based alert and confirm dialog.
44
55
![Vuejs Dialog Plugin](./src/example/img/html-enabled.png?raw=true "Vuejs Dialog Plugin example")
66
![Vuejs Dialog Plugin](./src/example/img/demo.gif?raw=true "Vuejs Dialog Plugin usage demo")

dist/vuejs-dialog.js

Lines changed: 0 additions & 178 deletions
This file was deleted.

dist/vuejs-dialog.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vuejs-dialog.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/app.main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>VueJs Plugin usage example</title>
6-
<link href="app.main.css?dff36cb7a3a8d7746d5f" rel="stylesheet"></head>
6+
<link href="app.main.css?94f6b950a82d5bc6a092" rel="stylesheet"></head>
77
<body>
88
<div id="app"></div>
99

10+
<script src="https://unpkg.com/vue@2.4.2/dist/vue.min.js"></script>
1011
<script type="text/javascript" src="../dist/vuejs-dialog.min.js"></script>
11-
<script type="text/javascript" src="app.main.js?dff36cb7a3a8d7746d5f"></script></body>
12+
<script type="text/javascript" src="app.main.js?94f6b950a82d5bc6a092"></script></body>
1213
</html>

src/example/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<body>
88
<div id="app"></div>
99

10+
<script src="https://unpkg.com/vue@2.4.2/dist/vue.min.js"></script>
1011
<script type="text/javascript" src="../dist/vuejs-dialog.min.js"></script>
1112
</body>
1213
</html>

src/example/js/app.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
"use strict"
22

33
import Vue from "vue"
4-
const VuejsDialog = window.vuejsDialog.default
4+
import VuejsDialog from 'vuejs-dialog'
55
import Notification from 'vue-notification'
66
import AppComponent from '../components/app.vue'
77

8-
console.log(VuejsDialog, VuejsDialog.default)
9-
108
Vue.use(VuejsDialog)
119
Vue.use(Notification)
1210

webpack.config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ const EXAMPLE = Object.assign({}, COMMON, {
8585
compress: true,
8686
port: 9000
8787
},
88+
externals: {
89+
'vue': 'Vue',
90+
'vuejs-dialog': 'VuejsDialog'
91+
},
8892
plugins: [
8993
extractSass,
9094
new HtmlWebpackPlugin({
@@ -100,7 +104,7 @@ const DIST = Object.assign({}, COMMON, {
100104
name: 'dist',
101105
entry: './src/plugin/',
102106
output: {
103-
library: 'vuejsDialog',
107+
library: 'VuejsDialog',
104108
libraryTarget: 'umd',
105109
path: path.resolve(__dirname, './dist'),
106110
publicPath: '/dist/',
@@ -128,10 +132,15 @@ if (isProduction) {
128132
})
129133
])
130134

131-
135+
EXAMPLE.devtool = '#none'
132136
EXAMPLE.plugins = (EXAMPLE.plugins || []).concat([
137+
new webpack.DefinePlugin({
138+
'process.env': {
139+
NODE_ENV: '"production"'
140+
}
141+
}),
133142
new webpack.optimize.UglifyJsPlugin({
134-
sourceMap: true,
143+
sourceMap: false,
135144
compress: {
136145
warnings: false
137146
}

0 commit comments

Comments
 (0)