mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
* ES6 tests now run directly in Node.js. * Create `examples` folder to contain multiple standalone examples. * Fix precommit hook
86 lines
1.6 KiB
JavaScript
86 lines
1.6 KiB
JavaScript
const {resolve} = require('path');
|
|
const webpack = require('webpack');
|
|
|
|
module.exports = {
|
|
// Bundle the transpiled code in dist
|
|
entry: {
|
|
lib: resolve('./dist/index.js'),
|
|
test: resolve('./test/index.js')
|
|
},
|
|
|
|
// Generate a bundle in dist folder
|
|
output: {
|
|
path: resolve('./dist'),
|
|
filename: '[name]-bundle.js',
|
|
library: 'react-map-gl',
|
|
libraryTarget: 'umd'
|
|
},
|
|
|
|
// Exclude any non-relative imports from resulting bundle
|
|
externals: [
|
|
/^[a-z\-0-9]+$/
|
|
],
|
|
|
|
stats: {
|
|
warnings: false
|
|
},
|
|
|
|
// devtool: 'source-maps'
|
|
resolve: {
|
|
alias: {
|
|
'react-map-gl': resolve('./dist'),
|
|
'react-map-gl/test': resolve('./test')
|
|
}
|
|
},
|
|
|
|
module: {
|
|
rules: [
|
|
{
|
|
// Compile ES2015 using buble
|
|
test: /\.js$/,
|
|
loader: 'buble-loader',
|
|
include: [/src/, /test/],
|
|
options: {
|
|
objectAssign: 'Object.assign',
|
|
transforms: {
|
|
dangerousForOf: true,
|
|
modules: false
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
plugins: [
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
output: {
|
|
comments: false
|
|
}
|
|
})
|
|
]
|
|
/*
|
|
plugins: [
|
|
new webpack.optimize.AggressiveMergingPlugin(),
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
sourceMap: false,
|
|
compress: {
|
|
sequences: true,
|
|
dead_code: true,
|
|
conditionals: true,
|
|
booleans: true,
|
|
unused: true,
|
|
if_return: true,
|
|
join_vars: true,
|
|
drop_console: true
|
|
},
|
|
mangle: {
|
|
except: ['$super', '$', 'exports', 'require']
|
|
},
|
|
output: {
|
|
comments: false
|
|
}
|
|
})
|
|
]
|
|
*/
|
|
};
|