antv-l7/webpack.config.js

50 lines
1.0 KiB
JavaScript
Executable File

const webpack = require('webpack');
const resolve = require('path').resolve;
const pkg = require('./package.json');
module.exports = {
devtool: 'cheap-source-map',
entry: {
L7: './src/index.js'
},
output: {
filename: '[name].js',
library: 'L7',
libraryTarget: 'umd',
path: resolve(__dirname, 'build/')
},
module: {
rules: [
{
test: /\.js$/,
// exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
babelrc: true
}
}
},
{
test: /\.glsl$/,
use: {
loader: 'glsl-shaders-loader'
}
},
{
test: /global\.js$/,
use: {
loader: 'string-replace-loader',
options: {
search: '____L7_VERSION____',
replace: pkg.version
}
}
}
]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
]
};