mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 09:50:21 +00:00
* Remove Vue dependency and change extends Signed-off-by: Jakub Juszczak <netghost03@gmail.com> * 💎 Release new version 3.0.0-rc0 * ⬆️ Update examples * 📝 Update README.md * ⬆️ Update examples * ⬆️ Update englishd docs * ⬆️ Update transalted docs with current code examples * 🔥 Remove dist files from gitignore * ⬆️ Update dependencies vue and chartjs * Change private data Implements #182. The private chart instance is now in the vue.js data model. And can be accessed over `this.$data._chart` Updated unit tests * 📝 Update docs with private data * ✨ Add codeclimate ignore * ⬆️ Update codeclimate * ⬆️ Update codeclimate * ⬆️ Update codeclimate Add build and config folders to ignore
96 lines
2.0 KiB
JavaScript
96 lines
2.0 KiB
JavaScript
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');
|
|
|
|
var banner = [
|
|
npmCfg.name + ' v' + npmCfg.version,
|
|
'(c) ' + (new Date().getFullYear()) + ' ' + npmCfg.author,
|
|
npmCfg.homepage
|
|
].join('\n')
|
|
|
|
module.exports = {
|
|
entry: {
|
|
'vue-chartjs': './src/index.js'
|
|
},
|
|
output: {
|
|
filename: './dist/[name].js',
|
|
library: 'VueChartJs',
|
|
libraryTarget: 'umd',
|
|
umdNamedDefine: true
|
|
},
|
|
externals: {
|
|
'chart.js': 'chart.js'
|
|
},
|
|
module: {
|
|
preLoaders: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'eslint',
|
|
include: projectRoot,
|
|
exclude: /node_modules/
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'eslint',
|
|
include: projectRoot,
|
|
exclude: /node_modules/
|
|
}
|
|
],
|
|
loaders: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'vue'
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
loader: 'babel'
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
loader: cssLoader
|
|
},
|
|
{
|
|
test: /\.s[a|c]ss$/,
|
|
loader: ExtractTextPlugin.extract('style-loader','css-loader!sass-loader')
|
|
},
|
|
{
|
|
test: /\.json$/, loader: 'json'
|
|
}
|
|
]
|
|
},
|
|
eslint: {
|
|
formatter: require('eslint-friendly-formatter')
|
|
},
|
|
babel: {
|
|
presets: ['es2015'],
|
|
plugins: ['transform-runtime']
|
|
},
|
|
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
|
|
}
|
|
}),
|
|
new webpack.optimize.OccurenceOrderPlugin()
|
|
// new ExtractTextPlugin('build.css')
|
|
]
|
|
}
|