mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 09:50:21 +00:00
🔥 Remove full build with bundled chart.js
This commit is contained in:
@@ -1,92 +0,0 @@
|
||||
// var vue = require('vue-loader')
|
||||
var path = require('path')
|
||||
var webpack = require('webpack')
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
var projectRoot = path.resolve(__dirname, '../')
|
||||
var cssLoader = ExtractTextPlugin.extract('style-loader', 'css-loader')
|
||||
const npmCfg = require('../package.json')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
|
||||
var banner = [
|
||||
npmCfg.name + ' v' + npmCfg.version,
|
||||
'(c) ' + (new Date().getFullYear()) + ' ' + npmCfg.author,
|
||||
npmCfg.homepage
|
||||
].join('\n')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'vue-chartjs': './src/index.js'
|
||||
},
|
||||
output: {
|
||||
filename: './dist/[name].full.js',
|
||||
library: 'VueChartJs',
|
||||
libraryTarget: 'umd',
|
||||
umdNamedDefine: true
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js',
|
||||
'@': resolve('src')
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|vue)$/,
|
||||
loader: 'eslint-loader',
|
||||
enforce: 'pre',
|
||||
include: [resolve('src'), resolve('test')],
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [resolve('src'), resolve('test')]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: cssLoader
|
||||
},
|
||||
{
|
||||
test: /\.s[a|c]ss$/,
|
||||
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')
|
||||
},
|
||||
{
|
||||
test: /\.json$/,
|
||||
loader: 'json-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.BannerPlugin(banner)
|
||||
]
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
|
||||
delete module.exports.devtool
|
||||
module.exports.plugins = [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
17
build/webpack.release.full.min.js
vendored
17
build/webpack.release.full.min.js
vendored
@@ -1,17 +0,0 @@
|
||||
var config = require('./webpack.release.full.js')
|
||||
var webpack = require('webpack')
|
||||
|
||||
config.output.filename = config.output.filename.replace(/\.js$/, '.min.js')
|
||||
|
||||
delete config.devtool
|
||||
|
||||
config.plugins = [
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
sourceMap: false,
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
})
|
||||
]
|
||||
|
||||
module.exports = config
|
||||
@@ -26,7 +26,12 @@ module.exports = {
|
||||
umdNamedDefine: true
|
||||
},
|
||||
externals: {
|
||||
'chart.js': 'chart.js'
|
||||
'chart.js': {
|
||||
root: 'Chart',
|
||||
commonjs: 'chart.js',
|
||||
commonjs2: 'chart.js',
|
||||
amd: 'chart.js'
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
@@ -71,7 +76,8 @@ module.exports = {
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.BannerPlugin(banner)
|
||||
new webpack.BannerPlugin(banner),
|
||||
new webpack.optimize.ModuleConcatenationPlugin()
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
34137
dist/vue-chartjs.full.js
vendored
34137
dist/vue-chartjs.full.js
vendored
File diff suppressed because it is too large
Load Diff
1
dist/vue-chartjs.full.min.js
vendored
1
dist/vue-chartjs.full.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user