mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
- move gitbook files into their own folder at docs/gitbook
- rebuild homepage at `docs/homepage`
This commit is contained in:
+25
-2
@@ -2,13 +2,23 @@ var path = require('path')
|
||||
var config = require('../config')
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
|
||||
/**
|
||||
* Get the path to the assetsSubDirectory
|
||||
* @param _path
|
||||
* @returns {*|string}
|
||||
*/
|
||||
exports.assetsPath = function (_path) {
|
||||
return path.posix.join(config.build.assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate loader string to be used with extract text plugin
|
||||
* @param options
|
||||
* @returns {{css: *, postcss: *, less: *, sass: *, scss: *, stylus: *, styl: *}}
|
||||
*/
|
||||
exports.cssLoaders = function (options) {
|
||||
options = options || {}
|
||||
// generate loader string to be used with extract text plugin
|
||||
|
||||
function generateLoaders (loaders) {
|
||||
var sourceLoader = loaders.map(function (loader) {
|
||||
var extraParamChar
|
||||
@@ -41,7 +51,11 @@ exports.cssLoaders = function (options) {
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
/**
|
||||
* Generate loaders for standalone style files (outside of .vue)
|
||||
* @param options
|
||||
* @returns {Array}
|
||||
*/
|
||||
exports.styleLoaders = function (options) {
|
||||
var output = []
|
||||
var loaders = exports.cssLoaders(options)
|
||||
@@ -54,3 +68,12 @@ exports.styleLoaders = function (options) {
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
/**
|
||||
* Are we serving the docs or
|
||||
* the dev environment?
|
||||
* @returns {boolean}
|
||||
*/
|
||||
exports.shouldServeHomepage = function () {
|
||||
return process.argv.indexOf('--docs') > 0
|
||||
}
|
||||
@@ -5,7 +5,7 @@ var projectRoot = path.resolve(__dirname, '../')
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: process.argv.indexOf('--docs') > 0 ? './docs/docs.js' : './src/dev.js',
|
||||
app: utils.shouldServeHomepage() ? './docs/homepage/home.js' : './src/dev.js',
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = merge(baseWebpackConfig, {
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: process.argv.indexOf('--docs') > 0 ? './docs/docs.html' : 'dev.html',
|
||||
template: utils.shouldServeHomepage() ? './docs/homepage/home.html' : 'dev.html',
|
||||
inject: true
|
||||
})
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user