Skip to content

Commit a5d97b5

Browse files
committed
re-format whitespaces in webpack files
1 parent 8cef849 commit a5d97b5

File tree

596 files changed

+54752
-52285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

596 files changed

+54752
-52285
lines changed

browser/templates/sample/webpack.config.js

Lines changed: 92 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,101 @@ const path = require('path');
55
const webpack = require('webpack');
66

77
module.exports = env => {
8-
console.log("env:");
9-
console.log(env);
10-
const isLegacy = !!env.legacy && !(env.legacy == "false");
11-
const isProd = env.NODE_ENV === 'production';
12-
const presets = [
13-
["@babel/preset-env", {
14-
"useBuiltIns": "usage",
15-
"corejs": 3,
16-
"targets": {
17-
"browsers": isLegacy ? ["defaults"] : [
18-
"last 2 Chrome versions",
19-
"last 2 Safari versions",
20-
"last 2 iOS versions",
21-
"last 2 Firefox versions",
22-
"last 2 Edge versions"]
23-
}
24-
}],
25-
"@babel/preset-typescript"
26-
];
27-
28-
return {
29-
entry: isLegacy ? [
30-
path.resolve(__dirname, 'node_modules/@webcomponents/custom-elements'),
31-
path.resolve(__dirname, 'node_modules/@webcomponents/template'),
32-
path.resolve(__dirname, 'src')
33-
] : path.resolve(__dirname, 'src'),
34-
devtool: isProd ? false : 'source-map',
35-
output: {
36-
filename: isProd ? '[fullhash].bundle.js' : '[fullhash].bundle.js',
37-
globalObject: 'this',
38-
path: path.resolve(__dirname, 'dist'),
39-
},
8+
const nodeEnv = process.env.NODE_ENV || 'development';
9+
const isProd = nodeEnv === 'production';
10+
const isLegacy = !!process.env.legacy && !(process.env.legacy == "false");
11+
console.log(">> webpack nodeEnv=" + nodeEnv);
12+
console.log(">> webpack isProd=" + isProd);
13+
console.log(">> webpack isLegacy=" + isLegacy);
14+
const presets = [
15+
["@babel/preset-env", {
16+
"useBuiltIns": "usage",
17+
"corejs": 3,
18+
"targets": {
19+
"browsers": isLegacy ? ["defaults"] : [
20+
"last 2 Chrome versions",
21+
"last 2 Safari versions",
22+
"last 2 iOS versions",
23+
"last 2 Firefox versions",
24+
"last 2 Edge versions"]
25+
}
26+
}],
27+
"@babel/preset-typescript"
28+
];
4029

41-
resolve: {
42-
mainFields: ['esm2015', 'module', 'main'],
43-
extensions: ['.ts', '.js', '.json'],
44-
plugins: [new TsconfigPathsPlugin({
45-
configFile: './tsconfig.json',
46-
extensions: ['.ts', '.js'],
47-
mainFields: ['esm2015', 'module', 'main']
48-
})]
49-
},
30+
return {
31+
entry: isLegacy ? [
32+
path.resolve(__dirname, 'node_modules/@webcomponents/custom-elements'),
33+
path.resolve(__dirname, 'node_modules/@webcomponents/template'),
34+
path.resolve(__dirname, 'src')
35+
] : path.resolve(__dirname, 'src'),
36+
devtool: isProd ? false : 'source-map',
37+
output: {
38+
filename: isProd ? '[fullhash].bundle.js' : '[fullhash].bundle.js',
39+
globalObject: 'this',
40+
path: path.resolve(__dirname, 'dist'),
41+
},
5042

51-
module: {
52-
rules: [
53-
{ test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] },
54-
{ test: /\.(csv|tsv)$/, use: ['csv-loader'] },
55-
{ test: /\.xml$/, use: ['xml-loader'] },
56-
{ test: /\.css$/, sideEffects: true, use: ['style-loader', 'css-loader'] },
57-
{ test: /worker\.(ts|js)$/,
58-
use: [
59-
{ loader: 'worker-loader'},
60-
{ loader: 'babel-loader', options: {
61-
"compact": isProd ? true : false,
62-
"presets": presets,
63-
"plugins": [
64-
"@babel/plugin-proposal-class-properties",
65-
"@babel/plugin-transform-runtime"
66-
] }
67-
}
68-
]
43+
resolve: {
44+
mainFields: ['esm2015', 'module', 'main'],
45+
extensions: ['.ts', '.js', '.json'],
46+
plugins: [new TsconfigPathsPlugin({
47+
configFile: './tsconfig.json',
48+
extensions: ['.ts', '.js'],
49+
mainFields: ['esm2015', 'module', 'main']
50+
})]
6951
},
70-
{ test: /\.(ts|js)$/, loader: 'babel-loader',
71-
options: {
72-
"compact": isProd ? true : false,
73-
"presets": presets,
74-
"plugins": [
75-
"@babel/plugin-proposal-class-properties",
76-
"@babel/plugin-transform-runtime"
77-
]
52+
53+
module: {
54+
rules: [
55+
{ test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] },
56+
{ test: /\.(csv|tsv)$/, use: ['csv-loader'] },
57+
{ test: /\.xml$/, use: ['xml-loader'] },
58+
{ test: /\.css$/, sideEffects: true, use: ['style-loader', 'css-loader'] },
59+
{
60+
test: /worker\.(ts|js)$/,
61+
use: [
62+
{ loader: 'worker-loader' },
63+
{
64+
loader: 'babel-loader', options: {
65+
"compact": isProd ? true : false,
66+
"presets": presets,
67+
"plugins": [
68+
"@babel/plugin-proposal-class-properties",
69+
"@babel/plugin-transform-runtime"
70+
]
71+
}
72+
}
73+
]
74+
},
75+
{
76+
test: /\.(ts|js)$/, loader: 'babel-loader',
77+
options: {
78+
"compact": isProd ? true : false,
79+
"presets": presets,
80+
"plugins": [
81+
"@babel/plugin-proposal-class-properties",
82+
"@babel/plugin-transform-runtime"
83+
]
84+
},
85+
exclude:
86+
function (modulePath) {
87+
return /node_modules/.test(modulePath) &&
88+
!/igniteui-webcomponents/.test(modulePath) &&
89+
!/lit-html/.test(modulePath);
90+
}
91+
}],
7892
},
79-
exclude:
80-
function(modulePath) {
81-
return /node_modules/.test(modulePath) &&
82-
!/igniteui-webcomponents/.test(modulePath) &&
83-
!/lit-html/.test(modulePath);
84-
}
85-
}],
86-
},
8793

88-
plugins: [
89-
new webpack.DefinePlugin({
90-
'process.env': {
91-
NODE_ENV: env.NODE_ENV
92-
}
93-
}),
94-
new HtmlWebpackPlugin({
95-
title: 'for-cs',
96-
template: 'index.html'
97-
}),
98-
new ForkTsCheckerWebpackPlugin()
99-
]
100-
};
94+
plugins: [
95+
new webpack.DefinePlugin({
96+
'process.env.NODE_ENV': JSON.stringify(nodeEnv)
97+
}),
98+
new HtmlWebpackPlugin({
99+
title: 'for-cs',
100+
template: 'index.html'
101+
}),
102+
new ForkTsCheckerWebpackPlugin()
103+
]
104+
};
101105
};

gulpfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,9 @@ exports.simplifySamples = simplifySamples = gulp.series(
9494
sb.simplifySamples,
9595
);
9696

97-
exports.updateIG = sb.updateIG;
97+
exports.updateIG = sb.updateIG;
98+
99+
exports.updateWebpackConfigs = updateWebpackConfigs = gulp.series(
100+
sb.findSamples,
101+
sb.updateSampleWebpackConfigs,
102+
);

samples/charts/category-chart/annotations-all/webpack.config.js

Lines changed: 92 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,101 @@ const path = require('path');
55
const webpack = require('webpack');
66

77
module.exports = env => {
8-
const nodeEnv = process.env.NODE_ENV || 'development';
9-
const isProd = nodeEnv === 'production';
10-
const isLegacy = !!process.env.legacy && !(process.env.legacy == "false");
11-
console.log(">> webpack nodeEnv=" + nodeEnv);
12-
console.log(">> webpack isProd=" + isProd);
13-
console.log(">> webpack isLegacy=" + isLegacy);
14-
const presets = [
15-
["@babel/preset-env", {
16-
"useBuiltIns": "usage",
17-
"corejs": 3,
18-
"targets": {
19-
"browsers": isLegacy ? ["defaults"] : [
20-
"last 2 Chrome versions",
21-
"last 2 Safari versions",
22-
"last 2 iOS versions",
23-
"last 2 Firefox versions",
24-
"last 2 Edge versions"]
25-
}
26-
}],
27-
"@babel/preset-typescript"
28-
];
29-
30-
return {
31-
entry: isLegacy ? [
32-
path.resolve(__dirname, 'node_modules/@webcomponents/custom-elements'),
33-
path.resolve(__dirname, 'node_modules/@webcomponents/template'),
34-
path.resolve(__dirname, 'src')
35-
] : path.resolve(__dirname, 'src'),
36-
devtool: isProd ? false : 'source-map',
37-
output: {
38-
filename: isProd ? '[fullhash].bundle.js' : '[fullhash].bundle.js',
39-
globalObject: 'this',
40-
path: path.resolve(__dirname, 'dist'),
41-
},
8+
const nodeEnv = process.env.NODE_ENV || 'development';
9+
const isProd = nodeEnv === 'production';
10+
const isLegacy = !!process.env.legacy && !(process.env.legacy == "false");
11+
console.log(">> webpack nodeEnv=" + nodeEnv);
12+
console.log(">> webpack isProd=" + isProd);
13+
console.log(">> webpack isLegacy=" + isLegacy);
14+
const presets = [
15+
["@babel/preset-env", {
16+
"useBuiltIns": "usage",
17+
"corejs": 3,
18+
"targets": {
19+
"browsers": isLegacy ? ["defaults"] : [
20+
"last 2 Chrome versions",
21+
"last 2 Safari versions",
22+
"last 2 iOS versions",
23+
"last 2 Firefox versions",
24+
"last 2 Edge versions"]
25+
}
26+
}],
27+
"@babel/preset-typescript"
28+
];
4229

43-
resolve: {
44-
mainFields: ['esm2015', 'module', 'main'],
45-
extensions: ['.ts', '.js', '.json'],
46-
plugins: [new TsconfigPathsPlugin({
47-
configFile: './tsconfig.json',
48-
extensions: ['.ts', '.js'],
49-
mainFields: ['esm2015', 'module', 'main']
50-
})]
51-
},
30+
return {
31+
entry: isLegacy ? [
32+
path.resolve(__dirname, 'node_modules/@webcomponents/custom-elements'),
33+
path.resolve(__dirname, 'node_modules/@webcomponents/template'),
34+
path.resolve(__dirname, 'src')
35+
] : path.resolve(__dirname, 'src'),
36+
devtool: isProd ? false : 'source-map',
37+
output: {
38+
filename: isProd ? '[fullhash].bundle.js' : '[fullhash].bundle.js',
39+
globalObject: 'this',
40+
path: path.resolve(__dirname, 'dist'),
41+
},
5242

53-
module: {
54-
rules: [
55-
{ test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] },
56-
{ test: /\.(csv|tsv)$/, use: ['csv-loader'] },
57-
{ test: /\.xml$/, use: ['xml-loader'] },
58-
{ test: /\.css$/, sideEffects: true, use: ['style-loader', 'css-loader'] },
59-
{ test: /worker\.(ts|js)$/,
60-
use: [
61-
{ loader: 'worker-loader'},
62-
{ loader: 'babel-loader', options: {
63-
"compact": isProd ? true : false,
64-
"presets": presets,
65-
"plugins": [
66-
"@babel/plugin-proposal-class-properties",
67-
"@babel/plugin-transform-runtime"
68-
] }
69-
}
70-
]
43+
resolve: {
44+
mainFields: ['esm2015', 'module', 'main'],
45+
extensions: ['.ts', '.js', '.json'],
46+
plugins: [new TsconfigPathsPlugin({
47+
configFile: './tsconfig.json',
48+
extensions: ['.ts', '.js'],
49+
mainFields: ['esm2015', 'module', 'main']
50+
})]
7151
},
72-
{ test: /\.(ts|js)$/, loader: 'babel-loader',
73-
options: {
74-
"compact": isProd ? true : false,
75-
"presets": presets,
76-
"plugins": [
77-
"@babel/plugin-proposal-class-properties",
78-
"@babel/plugin-transform-runtime"
79-
]
52+
53+
module: {
54+
rules: [
55+
{ test: /\.(png|svg|jpg|gif)$/, use: ['file-loader'] },
56+
{ test: /\.(csv|tsv)$/, use: ['csv-loader'] },
57+
{ test: /\.xml$/, use: ['xml-loader'] },
58+
{ test: /\.css$/, sideEffects: true, use: ['style-loader', 'css-loader'] },
59+
{
60+
test: /worker\.(ts|js)$/,
61+
use: [
62+
{ loader: 'worker-loader' },
63+
{
64+
loader: 'babel-loader', options: {
65+
"compact": isProd ? true : false,
66+
"presets": presets,
67+
"plugins": [
68+
"@babel/plugin-proposal-class-properties",
69+
"@babel/plugin-transform-runtime"
70+
]
71+
}
72+
}
73+
]
74+
},
75+
{
76+
test: /\.(ts|js)$/, loader: 'babel-loader',
77+
options: {
78+
"compact": isProd ? true : false,
79+
"presets": presets,
80+
"plugins": [
81+
"@babel/plugin-proposal-class-properties",
82+
"@babel/plugin-transform-runtime"
83+
]
84+
},
85+
exclude:
86+
function (modulePath) {
87+
return /node_modules/.test(modulePath) &&
88+
!/igniteui-webcomponents/.test(modulePath) &&
89+
!/lit-html/.test(modulePath);
90+
}
91+
}],
8092
},
81-
exclude:
82-
function(modulePath) {
83-
return /node_modules/.test(modulePath) &&
84-
!/igniteui-webcomponents/.test(modulePath) &&
85-
!/lit-html/.test(modulePath);
86-
}
87-
}],
88-
},
8993

90-
plugins: [
91-
new webpack.DefinePlugin({
92-
'process.env.NODE_ENV' : JSON.stringify(nodeEnv)
93-
}),
94-
new HtmlWebpackPlugin({
95-
title: 'for-cs',
96-
template: 'index.html'
97-
}),
98-
new ForkTsCheckerWebpackPlugin()
99-
]
100-
};
94+
plugins: [
95+
new webpack.DefinePlugin({
96+
'process.env.NODE_ENV': JSON.stringify(nodeEnv)
97+
}),
98+
new HtmlWebpackPlugin({
99+
title: 'for-cs',
100+
template: 'index.html'
101+
}),
102+
new ForkTsCheckerWebpackPlugin()
103+
]
104+
};
101105
};

0 commit comments

Comments
 (0)