Skip to content

Commit ce7d66a

Browse files
authored
chore(examples/fdc3-chart): Move build to webpack (#1054)
1 parent 280bf3b commit ce7d66a

File tree

5 files changed

+540
-5303
lines changed

5 files changed

+540
-5303
lines changed

examples/fdc3-chart-and-grid/js-chart/chart.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
import Chart from 'highcharts/es-modules/Core/Chart/Chart.js';
2-
import ColumnSeries from 'highcharts/es-modules/Series/Column/ColumnSeries.js';
3-
import NoDataToDisplay from 'highcharts/modules/no-data-to-display';
1+
// Morgan Stanley makes this available to you under the Apache License,
2+
// Version 2.0 (the "License"). You may obtain a copy of the License at
3+
//
4+
// http://www.apache.org/licenses/LICENSE-2.0.
5+
//
6+
// See the NOTICE file distributed with this work for additional information
7+
// regarding copyright ownership. Unless required by applicable law or agreed
8+
// to in writing, software distributed under the License is distributed on an
9+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10+
// or implied. See the License for the specific language governing permissions
11+
// and limitations under the License.
12+
13+
import NoDataToDisplay from 'highcharts/modules/no-data-to-display.js';
414
import * as Highcharts from 'highcharts';
515
import { ContextTypes } from '@finos/fdc3';
616
import { Intents } from '@finos/fdc3';

examples/fdc3-chart-and-grid/js-chart/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"type": "module",
88
"scripts": {
99
"clean": "rimraf dist",
10-
"bundle": "rollup -c",
11-
"build": "npm run clean && npm run bundle",
10+
"build": "npm run build:prod",
11+
"build:dev": "npm run clean && webpack --mode=development",
12+
"build:prod": "npm run clean && webpack --mode=production --node-env=production",
1213
"start": "http-server -p 8088"
1314
},
1415
"dependencies": {
@@ -21,8 +22,7 @@
2122
"devDependencies": {
2223
"http-server": "14.1.1",
2324
"rimraf": "6.0.1",
24-
"rollup": "4.44.1",
25-
"@rollup/plugin-commonjs": "28.0.6",
26-
"@rollup/plugin-node-resolve": "16.0.1"
25+
"webpack": "^5.95.0",
26+
"webpack-cli": "^6.0.1"
2727
}
2828
}

examples/fdc3-chart-and-grid/js-chart/rollup.config.js

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Generated using webpack-cli https://github.com/webpack/webpack-cli
2+
3+
const path = require('path');
4+
5+
const isProduction = process.env.NODE_ENV == 'production';
6+
7+
8+
const config = {
9+
entry: './chart.js',
10+
output: {
11+
path: path.resolve(__dirname, 'dist'),
12+
filename: 'bundle.js',
13+
libraryTarget: 'commonjs',
14+
module: false,
15+
iife: true
16+
17+
},
18+
plugins: [
19+
// Add your plugins here
20+
// Learn more about plugins from https://webpack.js.org/configuration/plugins/
21+
],
22+
module: {
23+
rules: [
24+
// Add your rules for custom modules here
25+
// Learn more about loaders from https://webpack.js.org/loaders/
26+
],
27+
},
28+
optimization: {
29+
minimize: false,
30+
},
31+
};
32+
33+
module.exports = () => {
34+
if (isProduction) {
35+
config.mode = 'production';
36+
} else {
37+
config.mode = 'development';
38+
}
39+
return config;
40+
};

0 commit comments

Comments
 (0)