kline-chart
Version:
本项目基于某K线插件做了一些封装和二次开发,使插件更加易用,方便后来的开发者.
66 lines (63 loc) • 1.66 kB
JavaScript
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: './src/entry.js',
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'kline.js',
libraryTarget: 'umd',
umdNamedDefine: true
},
plugins: [
new UglifyJsPlugin()
],
externals: {
jquery: {
commonjs: "jquery",
commonjs2: 'jquery',
amd: "jquery",
root: "$"
}
},
target: 'web',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-env'
],
plugins: [
'transform-class-properties'
]
}
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
loader: 'url-loader',
options: {
limit: 10000
}
},
{
test: /\.(html)$/,
use: {
loader: 'html-loader',
options: {
attrs: [':data-src']
}
}
}
]
}
};