Skip to content

Commit

Permalink
Merge pull request #5 from GrabarzUndPartner/feature/preview
Browse files Browse the repository at this point in the history
fix(preview): update readme; prepare for preview
  • Loading branch information
ThornWalli authored Jan 28, 2020
2 parents 4ed420e + 3267fbe commit 68f1de2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- if [ -z "$TRAVIS_PULL_REQUEST_SHA" ]; then export PT_COMMIT=$TRAVIS_COMMIT; else export PT_COMMIT=$TRAVIS_PULL_REQUEST_SHA; fi
# - echo $PT_COMMIT
# - echo $PT_BRANCH
- npm run build
- npm run build --base=/nuxt-custom-elements/
- stage: deploy
if: branch = master
install:
Expand All @@ -50,4 +50,6 @@ jobs:
local_dir: gh-pages/
on:
branch: master
edge: true


13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,17 @@ The custom elements contained in the page template can now be called.
## Preview

1. Start static server using `npm run start:build`
2. Open [http://127.0.0.1:3000](http://127.0.0.1:3000) in Browser.
1. Clone this repository
2. Install dependencies using `yarn install` or `npm install`
3. Build and start with express `npm run start:build`
4. Open [http://127.0.0.1:3000](http://127.0.0.1:3000) in Browser.

or look here

- [ComponentAppBundle](https://grabarzundpartner.github.io/nuxt-custom-elements/component-app-bundle.html)
- [ComponentAppAbstract](https://grabarzundpartner.github.io/nuxt-custom-elements/component-app-abstract.html)
- [ComponentAppHash](https://grabarzundpartner.github.io/nuxt-custom-elements/component-app-hash.html)
- [ComponentAppHistory](https://grabarzundpartner.github.io/nuxt-custom-elements/component-app-history.html)

## Development

Expand Down
17 changes: 11 additions & 6 deletions example/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
'@/../', {
analyzer: true,
polyfill: true,
publicPath: getBasePath(),
staticPath: resolve(process.cwd(), 'example/custom-element/static'),
entries: [
{
Expand All @@ -37,7 +38,7 @@ module.exports = {
path: '@/components/apps/AppAbstract',
options: {
props: {
basePath: '/'
basePath: getBasePath()
}
}
}
Expand All @@ -51,7 +52,7 @@ module.exports = {
path: '@/components/apps/AppHash',
options: {
props: {
basePath: '/'
basePath: getBasePath()
}
}
}
Expand All @@ -65,7 +66,7 @@ module.exports = {
path: '@/components/apps/AppHistory',
options: {
props: {
basePath: '/'
basePath: getBasePath()
}
}
}
Expand All @@ -79,7 +80,7 @@ module.exports = {
path: '@/components/apps/AppAbstract',
options: {
props: {
basePath: '/'
basePath: getBasePath()
}
}
},
Expand All @@ -88,7 +89,7 @@ module.exports = {
path: '@/components/apps/AppHash',
options: {
props: {
basePath: '/'
basePath: getBasePath()
}
}
},
Expand All @@ -97,7 +98,7 @@ module.exports = {
path: '@/components/apps/AppHistory',
options: {
props: {
basePath: '/'
basePath: getBasePath()
}
}
}
Expand All @@ -108,3 +109,7 @@ module.exports = {
]
]
}

function getBasePath () {
return process.env.npm_config_base || '/'
}
2 changes: 2 additions & 0 deletions lib/tmpl/index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<% if (base) { %>
<base href="<%= base %>" target="_blank">
<% } %>
</head>

<body>
Expand Down

0 comments on commit 68f1de2

Please sign in to comment.