Skip to content

Commit 68f9abe

Browse files
committed
FS-12113: Changed the array structure to object based.
1 parent 006e46c commit 68f9abe

File tree

2 files changed

+43
-42
lines changed

2 files changed

+43
-42
lines changed

scripts/build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@ gulp.task('typescript:modules', () => {
3636
});
3737

3838
gulp.task('build:webpack:umd', () => {
39-
const conf = webpackCfg[0];
39+
const conf = webpackCfg.umd;
4040
return gulp.src(conf.entry)
4141
.pipe(webpack(conf))
4242
.pipe(gulp.dest(conf.output.path));
4343
});
4444

4545
gulp.task('build:webpack:esm', () => {
46-
const conf = webpackCfg[1];
46+
const conf = webpackCfg.esm;
4747

4848
return gulp.src(conf.entry)
4949
.pipe(webpack(conf))
5050
.pipe(gulp.dest(conf.output.path));
5151
});
5252

5353
gulp.task('build:webpack:prod', () => {
54-
const conf = webpackCfg[2];
54+
const conf = webpackCfg.prod;
5555

5656
return gulp.src(conf.entry)
5757
.pipe(webpack(conf))

webpack.config.js

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -83,47 +83,48 @@ const baseConfig = {
8383
},
8484
};
8585

86-
const umd = merge({}, baseConfig, {
87-
output: {
88-
path: path.resolve(__dirname, 'build/browser'),
89-
filename: 'filestack.umd.js',
90-
library: 'filestack',
91-
libraryTarget: 'umd',
92-
93-
},
94-
});
95-
96-
const esm = merge({}, baseConfig, {
97-
output: {
98-
path: path.resolve(__dirname, 'build/browser'),
99-
filename: 'filestack.esm.js',
100-
library: {
101-
type: 'module',
86+
const webpackConfigs = {
87+
umd: merge({}, baseConfig, {
88+
output: {
89+
path: path.resolve(__dirname, 'build/browser'),
90+
filename: 'filestack.umd.js',
91+
library: 'filestack',
92+
libraryTarget: 'umd',
10293
},
103-
environment: {
94+
}),
95+
96+
esm: merge({}, baseConfig, {
97+
output: {
98+
path: path.resolve(__dirname, 'build/browser'),
99+
filename: 'filestack.esm.js',
100+
library: {
101+
type: 'module',
102+
},
103+
environment: {
104+
module: true,
105+
},
104106
module: true,
105107
},
106-
module: true,
107-
},
108-
experiments: {
109-
outputModule: true,
110-
},
111-
});
108+
experiments: {
109+
outputModule: true,
110+
},
111+
}),
112112

113-
const prod = merge({}, baseConfig, {
114-
output: {
115-
path: path.resolve(__dirname, 'build/browser'),
116-
filename: 'filestack.min.js',
117-
library: 'filestack',
118-
libraryTarget: 'umd'
119-
},
120-
plugins: [
121-
new WebpackAssetsManifest({
122-
writeToDisk: true,
123-
integrity: true,
124-
output: 'manifest.json',
125-
}),
126-
],
127-
});
113+
prod: merge({}, baseConfig, {
114+
output: {
115+
path: path.resolve(__dirname, 'build/browser'),
116+
filename: 'filestack.min.js',
117+
library: 'filestack',
118+
libraryTarget: 'umd'
119+
},
120+
plugins: [
121+
new WebpackAssetsManifest({
122+
writeToDisk: true,
123+
integrity: true,
124+
output: 'manifest.json',
125+
}),
126+
],
127+
})
128+
};
128129

129-
module.exports = [umd, esm, prod];
130+
module.exports = webpackConfigs;

0 commit comments

Comments
 (0)