@jamesblanksby/toolkit 1.1.1 → 1.2.0

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.
package/build/shopify.js CHANGED
@@ -4,11 +4,12 @@ import uglifyjs from 'uglify-js';
4
4
 
5
5
  import { MemoryFile } from './../index.js';
6
6
 
7
- const { PWD, } = process.env;
8
-
9
7
  function flattenAsset(file, type) {
10
- const name = path.relative(PWD, file.path)
11
- .replace(new RegExp(`src/${type}/?`), '')
8
+ const assetDir = process.env.ASSET_DIR || process.env.PWD;
9
+
10
+ const name = path.relative(assetDir, file.path)
11
+ .replace(new RegExp(`src/?`), '')
12
+ .replace(new RegExp(`${type}/?`), '')
12
13
  .replace(new RegExp('/', 'g'), '_');
13
14
 
14
15
  return new MemoryFile(name, file.buffer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamesblanksby/toolkit",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
package/toolkit.config.js CHANGED
@@ -63,10 +63,11 @@ function minify() {
63
63
 
64
64
  async function shopify() {
65
65
  const shopifyDir = `${PWD}/../shopify/assets`;
66
+ const assetDir = process.env.ASSET_DIR || PWD;
66
67
 
67
68
  await src(`${shopifyDir}/**`).rm().toArray();
68
69
 
69
- return src(`${PWD}/**/(css|font|gfx|plugin|script)/**`, { ignore: '**/node_modules/**', })
70
+ return src(`${assetDir}/**/(css|font|gfx|plugin|script)/**`, { ignore: '**/node_modules/**', })
70
71
  .pipe(shopifyFlatten)
71
72
  .dest(shopifyDir);
72
73
  }