mirror of
https://github.com/heavyai/heavyai-charting.git
synced 2025-12-08 19:25:53 +00:00
* 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)
61 lines
1.2 KiB
JavaScript
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"
|
|
}),
|
|
]
|
|
};
|