8000 Add yarn serve to use as a local dev environment (#100) · cloudinary/cloudinary-vue@8425171 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8425171

Browse files
Add yarn serve to use as a local dev environment (#100)
* Add yarn serve to use as a local dev environment * Add playground files
1 parent be42325 commit 8425171

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
"name": "cloudinary-vue",
33
"version": "1.1.1",
44
"scripts": {
5+
"serve": "INTERNAL_DEPS=1 vue-cli-service serve ./playground/main.js",
56
"build": "vue-cli-service lint --fix; npm run build:styleguide; npm run build:lib",
67
"test": "vue-cli-service test:unit",
78
"tdd": "yarn run test --watch --coverage=false",
89
"bundlewatch": "bundlewatch --config ./bundlewatch.config.js",
910
"lint": "vue-cli-service lint",
1011
"build:lib": "vue-cli-service build --target lib --name Cloudinary src/index.js && npm run bundlewatch",
11-
"build:styleguide": "rm -rf docs/*; node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; STYLEGUIDE=1 vue-styleguidist build",
12+
"build:styleguide": "rm -rf docs/*; node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; INTERNAL_DEPS=1 vue-styleguidist build",
1213
"storybook:build": "vue-cli-service storybook:build -c config/storybook",
1314
"storybook:serve": "vue-cli-service storybook:serve -p 6006 -c config/storybook",
14-
"styleguide": "node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; STYLEGUIDE=1 vue-styleguidist server"
15+
"styleguide": "node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; INTERNAL_DEPS=1 vue-styleguidist server"
1516
},
1617
"main": "dist/Cloudinary.umd.js",
1718
"unpkg": "dist/Cloudinary.umd.min.js",

playground/App.vue

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<template>
2+
<div id="app">
3+
<cld-image
4+
cloudName="demo"
5+
public-id="woman"
6+
responsive="fill"
7+
>
8+
<cld-transformation
9+
crop="fill"
10+
width="auto"
11+
gravity="auto"
12+
/>
13+
</cld-image>
14+
15+
</div>
16+
</template>
17+
18+
<script>
19+
export default {
20+
name: 'App',
21+
components: {
22+
}
23+
}
24+
</script>
25+
26+
<style>
27+
#app {
28+
height:500px;
29+
font-family: Avenir, Helvetica, Arial, sans-serif;
30+
-webkit-font-smoothing: antialiased;
31+
-moz-osx-font-smoothing: grayscale;
32+
text-align: center;
33+
color: #2c3e50;
34+
margin-top: 60px;
35+
}
36+
</style>

playground/main.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Vue from 'vue' // Replaces Vue
2+
import App from './App.vue' // Some component app
3+
import Cloudinary, {CldContext, CldImage, CldTransformation, CldVideo} from "../src/index";
4+
5+
Vue.use(Cloudinary, {
6+
configuration: { cloudName: 'demo' },
7+
components: [ CldImage,CldTransformation,CldVideo,CldContext ]
8+
})
9+
10+
new Vue({
11+
render: h => h(App),
12+
}).$mount('#app')
13+

vue.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const nodeExternals = require("webpack-node-externals");
22

33
module.exports = {
44
configureWebpack: config => {
5-
if (process.env.STYLEGUIDE) {
5+
if (process.env.INTERNAL_DEPS) {
66
return;
77
}
88
config.externals = [nodeExternals()];

0 commit comments

Comments
 (0)
0