mod-build 3.5.2 → 3.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,11 @@
1
1
  const webpack = require('webpack-stream');
2
+ const glob = require('glob');
3
+
4
+ const entry = glob.sync('./src/scripts/**.ts').reduce((entry, path) => {
5
+ const pathName = path.replace(/(\.\/src\/scripts\/|\.ts)/g, ''); // remove `./src/scripts/`, `.ts`
6
+ entry[pathName] = path;
7
+ return entry;
8
+ }, {});
2
9
 
3
10
  module.exports = function(gulp, gulpPlugins, siteSettings, mode) {
4
11
  let assetUrl = siteSettings.tmpFolder + '/scripts';
@@ -7,18 +14,15 @@ module.exports = function(gulp, gulpPlugins, siteSettings, mode) {
7
14
  }
8
15
 
9
16
  return function() {
10
- return gulp.src('src/scripts/home.ts')
17
+ return gulp.src('src/scripts/**.ts')
11
18
  .on('error', function() {
12
19
  this.end();
13
20
  })
14
21
  .pipe(webpack({
15
22
  mode: mode,
16
- // entry: {
17
- // app: 'src/app.js',
18
- // test: 'test/test.js',
19
- // },
23
+ entry,
20
24
  output: {
21
- filename: 'home.js'
25
+ filename: '[name].js'
22
26
  },
23
27
  resolve: {
24
28
  // Add `.ts` and `.tsx` as a resolvable extension.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.5.2",
3
+ "version": "3.5.4",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -37,7 +37,9 @@
37
37
  } else {
38
38
  {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-addeventproperties-identify.js' }}
39
39
  }
40
- {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/google-tag-manager-head.js' }}
40
+ {{#unless nogtm}}
41
+ {{ fileInclude 'node_modules/mod-build/src/scripts/vendor/google-tag-manager-head.js' }}
42
+ {{/unless}}
41
43
  } catch (e) {}
42
44
  return;
43
45
  }