heavyai-charting/webpack.config.js
Chris Matzenbach 7dcb11b8af
Upgrade node to 24.11.0 (#703)
* Remove node-sass; upgrade to webpack 4; bump deps; upgrade to node 20

* Bump to node 24.11.0

* Upgrade sass, sass-loader and webpack (to v5, needed for sass-loader)
2025-12-04 15:15:09 -06:00

61 lines
1.2 KiB
JavaScript

const webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require('path')
module.exports = {
mode: "production",
context: __dirname,
entry: {
"charting": "./index.js"
},
resolve: {
fallback: {
"assert": require.resolve("assert/")
}
},
output: {
path: path.join(__dirname, "/dist"),
filename: "[name].js",
library: {
name: "charting",
type: "umd"
},
globalObject: 'this'
},
externals: {
"d3": "d3",
"crossfilter": {
"commonjs": "crossfilter",
"commonjs2": "crossfilter",
"amd": "crossfilter",
}
},
module: {
rules: [
{
test: /\.js?$/,
exclude: /node_modules\/(?!@mapbox-controls\/ruler)/,
use: "babel-loader"
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
},
{
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
}
]
},
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
}),
new MiniCssExtractPlugin({
filename: "charting.css"
}),
]
};