-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhuwenhan
committed
Feb 15, 2020
1 parent
60d8c1f
commit 2050b0e
Showing
6 changed files
with
1,109 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Vue from 'vue' | ||
import ImagePreview from 'vue-img-viewer' | ||
import Example from './pages/example.vue' | ||
|
||
Vue.use(ImagePreview) | ||
|
||
// if (module.hot) { | ||
// module.hot.accept() | ||
// } | ||
|
||
new Vue({ | ||
render: h => h(Example) | ||
}).$mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Vue-img-viewer Example</title> | ||
</head> | ||
<body style="padding: 0 20px"> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
const VueLoaderPlugin = require('vue-loader/lib/plugin') | ||
const HtmlWebpackPlugin = require('html-webpack-plugin') | ||
|
||
module.exports = { | ||
mode: 'development', | ||
|
||
entry: { | ||
app: path.join(__dirname, './app.js') | ||
}, | ||
|
||
output: { | ||
path: path.join(__dirname, '__build__'), | ||
filename: '[name].js', | ||
chunkFilename: '[id].chunk.js' | ||
}, | ||
|
||
resolve: { | ||
alias: { | ||
'vue-img-viewer': path.join(__dirname, '..', 'src') | ||
} | ||
}, | ||
|
||
devServer: { | ||
contentBase: path.join(__dirname, '__build__'), | ||
port: 9000, | ||
hot: true, | ||
clientLogLevel: 'none' | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: 'babel-loader' | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
use: 'vue-loader' | ||
}, | ||
{ | ||
test: /\.(css|scss)$/, | ||
use: ['vue-style-loader', 'css-loader', 'sass-loader'] | ||
} | ||
] | ||
}, | ||
|
||
optimization: { | ||
splitChunks: { | ||
cacheGroups: { | ||
shared: { | ||
name: 'shared', | ||
chunks: 'initial', | ||
minChunks: 2 | ||
} | ||
} | ||
} | ||
}, | ||
|
||
plugins: [ | ||
new VueLoaderPlugin(), | ||
new webpack.HotModuleReplacementPlugin(), | ||
new HtmlWebpackPlugin({ | ||
template: 'examples/index.html' | ||
}) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.