Initial commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
var version = require('../package.json').version;
|
||||
|
||||
var banner = 'CARTO.js https://carto.com/\n';
|
||||
banner += 'Version: ' + version + '\n';
|
||||
|
||||
module.exports = banner;
|
||||
@@ -0,0 +1,40 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const banner = require('./banner');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: './src/api/v4/index.js',
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../dist/public'),
|
||||
filename: 'carto.js',
|
||||
library: 'carto',
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
devtool: 'sourcemap',
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: [
|
||||
path.resolve(__dirname, '../node_modules'),
|
||||
path.resolve(__dirname, '../vendor')
|
||||
],
|
||||
options: {
|
||||
presets: ['env'],
|
||||
plugins: ['transform-object-rest-spread']
|
||||
}
|
||||
}]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
__ENV__: JSON.stringify(process.env.NODE_ENV)
|
||||
}),
|
||||
// Include only the lastest camshaft-reference
|
||||
new webpack.IgnorePlugin(/^\.\/((?!0\.59\.4).)*\/reference\.json$/),
|
||||
new webpack.BannerPlugin(banner)
|
||||
],
|
||||
optimization: {
|
||||
minimize: false
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
const banner = require('./banner');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: './src/api/v4/index.js',
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../dist/public'),
|
||||
filename: 'carto.min.js',
|
||||
library: 'carto',
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: [
|
||||
path.resolve(__dirname, '../node_modules'),
|
||||
path.resolve(__dirname, '../vendor')
|
||||
],
|
||||
options: {
|
||||
presets: ['env'],
|
||||
plugins: ['transform-object-rest-spread']
|
||||
}
|
||||
}]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
__ENV__: JSON.stringify(process.env.NODE_ENV)
|
||||
}),
|
||||
// Include only the lastest camshaft-reference
|
||||
new webpack.IgnorePlugin(/^\.\/((?!0\.59\.4).)*\/reference\.json$/),
|
||||
new webpack.BannerPlugin(banner)
|
||||
],
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
cache: false,
|
||||
parallel: true
|
||||
})
|
||||
]
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user