Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add yarn serve to use as a local dev environment #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"name": "cloudinary-vue",
"version": "1.1.1",
"scripts": {
"serve": "INTERNAL_DEPS=1 vue-cli-service serve ./playground/main.js",
"build": "vue-cli-service lint --fix; npm run build:styleguide; npm run build:lib",
"test": "vue-cli-service test:unit",
"tdd": "yarn run test --watch --coverage=false",
"bundlewatch": "bundlewatch --config ./bundlewatch.config.js",
"lint": "vue-cli-service lint",
"build:lib": "vue-cli-service build --target lib --name Cloudinary src/index.js && npm run bundlewatch",
"build:styleguide": "rm -rf docs/*; node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; STYLEGUIDE=1 vue-styleguidist build",
"build:styleguide": "rm -rf docs/*; node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; INTERNAL_DEPS=1 vue-styleguidist build",
"storybook:build": "vue-cli-service storybook:build -c config/storybook",
"storybook:serve": "vue-cli-service storybook:serve -p 6006 -c config/storybook",
"styleguide": "node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; STYLEGUIDE=1 vue-styleguidist server"
"styleguide": "node docs-sources/generateDocsLinks.js; vue-cli-service lint --fix; INTERNAL_DEPS=1 vue-styleguidist server"
},
"main": "dist/Cloudinary.umd.js",
"unpkg": "dist/Cloudinary.umd.min.js",
Expand Down
36 changes: 36 additions & 0 deletions playground/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<div id="app">
<cld-image
cloudName="demo"
public-id="woman"
responsive="fill"
>
<cld-transformation
crop="fill"
width="auto"
gravity="auto"
/>
</cld-image>

</div>
</template>

<script>
export default {
name: 'App',
components: {
}
}
</script>

<style>
#app {
height:500px;
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
13 changes: 13 additions & 0 deletions playground/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Vue from 'vue' // Replaces Vue
import App from './App.vue' // Some component app
import Cloudinary, {CldContext, CldImage, CldTransformation, CldVideo} from "../src/index";

Vue.use(Cloudinary, {
configuration: { cloudName: 'demo' },
components: [ CldImage,CldTransformation,CldVideo,CldContext ]
})

new Vue({
render: h => h(App),
}).$mount('#app')

2 changes: 1 addition & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const nodeExternals = require("webpack-node-externals");

module.exports = {
configureWebpack: config => {
if (process.env.STYLEGUIDE) {
if (process.env.INTERNAL_DEPS) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In VueJS, when building a library we externalize all of the node modules, as they're brought in as dependencies.

When developing locally, we want all INTERNAL_DEPS to be bundled, so we skip the nodeExternals() plugin.

This repurposes an old flag of the STYLEGUIDE which is no longer in use, but did the same thing

return;
}
config.externals = [nodeExternals()];
Expand Down