mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
fine tune build, add bower.json
This commit is contained in:
@@ -7,6 +7,7 @@ var config = require('../config')
|
||||
var ora = require('ora')
|
||||
var webpack = require('webpack')
|
||||
var webpackConfig = require('./webpack.prod.conf')
|
||||
var umdConfig = require('./webpack.umd.conf')
|
||||
|
||||
console.log(
|
||||
' Tip:\n' +
|
||||
@@ -22,6 +23,9 @@ rm('-rf', assetsPath)
|
||||
mkdir('-p', assetsPath)
|
||||
cp('-R', 'static/', assetsPath)
|
||||
|
||||
/**
|
||||
* Build the /dist/ folder (demo site)
|
||||
*/
|
||||
webpack(webpackConfig, function (err, stats) {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
@@ -33,3 +37,18 @@ webpack(webpackConfig, function (err, stats) {
|
||||
chunkModules: false
|
||||
}) + '\n')
|
||||
})
|
||||
|
||||
/**
|
||||
* Build the UMD module @ /umd/vue-select.js.
|
||||
*/
|
||||
webpack(umdConfig, function (err, stats) {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false,
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n')
|
||||
})
|
||||
@@ -0,0 +1,32 @@
|
||||
const webpack = require('webpack')
|
||||
const base = require('./webpack.base.conf')
|
||||
const config = require('../config')
|
||||
|
||||
base.entry = {
|
||||
lib: './src/index.js'
|
||||
}
|
||||
|
||||
base.output = {
|
||||
path: config.umd.assetsRoot,
|
||||
publicPath: config.umd.assetsPublicPath,
|
||||
filename: 'vue-select.js',
|
||||
library: 'VueSelect',
|
||||
libraryTarget: 'umd'
|
||||
}
|
||||
|
||||
var webpackConfig = Object.assign({}, base)
|
||||
|
||||
webpackConfig.devtool = '#source-map'
|
||||
webpackConfig.plugins = (webpackConfig.plugins || []).concat([
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: { warnings: false }
|
||||
}),
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
])
|
||||
|
||||
module.exports = webpackConfig
|
||||
Reference in New Issue
Block a user