Skip to content

Commit

Permalink
#2 Initial TODO List
Browse files Browse the repository at this point in the history
- move samples to docs (examples in future)
- tune webpack config for aliases
  • Loading branch information
kuzya-zz committed Jul 27, 2017
1 parent a4c3d4d commit f7c0f6a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
39 changes: 23 additions & 16 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var utils = require('./utils')
var vueLoaderConfig = require('./vue-loader.conf')

function resolve (dir) {
Expand All @@ -9,18 +9,28 @@ function resolve (dir) {

module.exports = {
entry: {
app: './src/main.js'
app: './docs/main.js'
},
output: {
path: config.docs.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production' ? config.docs.assetsPublicPath : config.dev.assetsPublicPath
publicPath: process.env.NODE_ENV === 'production'
? config.docs.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
modules: [
resolve('src'),
resolve('docs'),
resolve('node_modules')
],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'src': path.resolve(__dirname, '../src')
'vue$': 'vue/dist/vue',
'vue-vega': path.resolve(__dirname, '../src/index'), // for consistent docs
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../docs/assets'),
'examples': path.resolve(__dirname, '../docs/components')
}
},
module: {
Expand All @@ -42,28 +52,25 @@ module.exports = {
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
include: [resolve('src'), resolve('docs'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
test: /\.pug$/,
use: 'pug-loader',
include: [resolve('src'), resolve('docs')]
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
query: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
query: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main.js → docs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Vue from 'vue'
import App from './App.vue'

import VueVegaPlugin from './index'
import VueVegaPlugin from 'src/index'

Vue.config.productionTip = false
Vue.use(VueVegaPlugin)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/specs/components/BarChart.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import BarChart from 'src/components/BarChart'
import VueVegaPlugin from 'src/index'
import BarChart from 'examples/BarChart'
import VueVegaPlugin from 'vue-vega'

describe('BarChart.vue', () => {
let LocalVue = Vue.extend({})
Expand Down

0 comments on commit f7c0f6a

Please sign in to comment.