Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-beta.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusBorg committed Feb 24, 2017
2 parents a86b314 + c26de97 commit 5326d96
Show file tree
Hide file tree
Showing 53 changed files with 2,303 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
node-debug.log
TODO.md
yarn-error.log
yarn.lock
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# PortalVue

> A Portal Component for Vuejs, to render DOM outside of a component, anywhere in the document.
<p style="tex-align: center">
<img src="http://portal-vue.github.io" alt="PortalVue Logo">
</p>


For more detailed documentation and additional Information, please visit <a href="http://portal-vue.github.io">the docs</a>

## Installation

```
npm install -g portal-vue
// in .js
import PortalVue from 'portal-vue'
Vue.use(PortalVue)
```



## Usage

```html
<portal to="destination">
<p>This slot content will be rendered wherever the <portal-target> with name 'destination'
is located.</p>
</portal>

<portal-target name="destination">
<!--
This component can be located anwhere in your App.
The slot content of the above portal component will be rendered here.
-->
</portal-target>
```
32 changes: 32 additions & 0 deletions build/rollup.conf.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import babel from 'rollup-plugin-babel'
import vue from 'rollup-plugin-vue'
import commonjs from 'rollup-plugin-commonjs'
import nodeResolve from 'rollup-plugin-node-resolve'

const babelConfig = {
// runtimeHelpers: true,
exclude: 'node_modules/**',
}

const nodeResolveOptions = {
module: true, jsnext: true,
extensions: ['.js', '.vue'],
}

export default {
entry: './src/index.js',
external: ['vue'],
globals: {
vue: 'Vue',
},
format: 'umd',
moduleName: 'PortalVue',
dest: './dist/portal-vue.js', // equivalent to --output
sourceMap: true,
plugins: [
nodeResolve(nodeResolveOptions),
vue({ compileTemplate: false }),
commonjs(),
babel(babelConfig),
],
}
80 changes: 80 additions & 0 deletions build/webpack.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
var path = require('path')
var webpack = require('webpack')
var FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')

const config = {
entry: {
example: path.resolve(__dirname, '../example/index.js'),
vendor: ['vue'],
},
output: {
path: path.resolve(__dirname, '../example'),
publicPath: '/',
library: 'VuePortal',
libraryTarget: 'umd',
filename: '[name].build.js',
},
resolve: {
extensions: ['.js', '.json', '.vue'],
alias: {
'vue$': 'vue/dist/vue.common',
},
},
module: {
rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
exclude: /node_modules/,
options: {
formatter: require('eslint-friendly-formatter'),
},
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: path.resolve(__dirname, '../node_modules'),
},
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
},
],
},
{
test: /\.vue$/,
loader: 'vue-loader',
exclude: /node_modules/,
},
],
},
plugins: [
new FriendlyErrorsWebpackPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: process.env.NODE_ENV ? JSON.stringify(process.env.NODE_ENV) : "'development'",
},
}),
],
devtool: 'source-map',
performance: {
hints: false,
},
devServer: {
contentBase: 'example/',
inline: true,
hot: true,
quiet: true,
stats: {
colors: true,
chunks: false,
},
},
}

module.exports = config
9 changes: 9 additions & 0 deletions build/webpack.test.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var merge = require('webpack-merge')

var devConfig = require('./webpack.conf.js')

var config = merge(devConfig, {
devtool: '#inline-source-map',
})

module.exports = config
Loading

0 comments on commit 5326d96

Please sign in to comment.