Add example-{react, vue} (#209)

* Add example-{react, vue}

* Update CHANGELOG.md

* Update README.md
This commit is contained in:
Jaco Greeff
2019-09-16 20:46:47 +02:00
committed by GitHub
parent bff1651481
commit e87647e3d9
26 changed files with 886 additions and 124 deletions
+60
View File
@@ -0,0 +1,60 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright 2017-2019 @polkadot/example-vue authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const { WebpackPluginServe } = require('webpack-plugin-serve');
module.exports = {
context: __dirname,
devtool: 'cheap-eval-source-map',
entry: './src/index.ts',
mode: 'development',
output: {
chunkFilename: '[name].[chunkhash:8].js',
globalObject: '(typeof self !== \'undefined\' ? self : this)',
filename: '[name].js',
path: path.join(__dirname, 'build')
},
resolve: {
alias: {
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/src'),
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/src'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/src'),
'@polkadot/vue-identicon': path.resolve(__dirname, '../vue-identicon/src')
},
extensions: ['.js', '.ts', '.tsx']
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
options: require('../../babel.config.js')
}
]
},
{
test: /\.vue$/,
loader: 'vue-loader'
}
]
},
plugins: [
new WebpackPluginServe({
hmr: false, // switch off, Chrome WASM memory leak
liveReload: false, // explict off, overrides hmr
progress: false, // since we have hmr off, disable
port: 8080,
static: __dirname
}),
new VueLoaderPlugin()
],
watch: true
};