Louis authored on17/12/2018 23:06:28
Showing1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,101 +0,0 @@
1
-////////////////////////////////////////////////////////////////////////////////
2
-// Template vars injected by projess_js.py:
3
-
4
-// boolean
5
-const isSandbox = false;
6
-
7
-// Array with absolute file path strings
8
-const entryFilenames = ["_pkjs_shared_additions.js",
9
-"/home/louis/repos/synocam_home_switch/src/pkjs/index.js"];
10
-
11
-// folder path string
12
-const outputPath = "build";
13
-
14
-// file name string
15
-const outputFilename = "pebble-js-app.js";
16
-
17
-// Array with absolute folder path strings
18
-const resolveRoots = ["/home/louis/.pebble-sdk/SDKs/current/sdk-core/pebble/common/include",
19
-"/home/louis/.pebble-sdk/SDKs/current/sdk-core/pebble/common/tools/webpack",
20
-"/home/louis/.pebble-sdk/SDKs/current/node_modules",
21
-"/home/louis/repos/synocam_home_switch/build/js"];
22
-
23
-// Object, { alias1: 'path1', ... }
24
-const resolveAliases = {"app_package.json": "/home/louis/repos/synocam_home_switch/package.json",
25
-"pebble-clay": "pebble-clay/dist/js"};
26
-
27
-// null or Object with key 'sourceMapFilename'
28
-const sourceMapConfig = {"sourceMapFilename": "pebble-js-app.js.map"};
29
-
30
-////////////////////////////////////////////////////////////////////////////////
31
-// NOTE: Must escape dollar-signs, because this is a Python template!
32
-
33
-const webpack = require('webpack');
34
-
35
-module.exports = (() => {
36
-  // The basic config:
37
-  const config = {
38
-    entry: entryFilenames,
39
-    output: {
40
-        path: outputPath,
41
-        filename: outputFilename
42
-    },
43
-    target: 'node',
44
-    resolve: {
45
-        root: resolveRoots,
46
-        extensions: ['', '.js', '.json'],
47
-        alias: resolveAliases
48
-    },
49
-    resolveLoader: {
50
-        root: resolveRoots
51
-    }
52
-  };
53
-
54
-  if (sourceMapConfig) {
55
-    // Enable webpack's source map output:
56
-    config.devtool = 'source-map';
57
-    config.output.sourceMapFilename = sourceMapConfig.sourceMapFilename;
58
-    config.output.devtoolModuleFilenameTemplate = '[resource-path]';
59
-    config.output.devtoolFallbackModuleFilenameTemplate = '[resourcePath]?[hash]';
60
-  }
61
-
62
-  return config;
63
-})();
64
-
65
-module.exports.plugins = (() => {
66
-  const plugins = [
67
-    // Returns a non-zero exit code when webpack reports an error:
68
-    require('webpack-fail-plugin'),
69
-
70
-    // Includes _message_keys_wrapper in every build to mimic old loader.js:
71
-    new webpack.ProvidePlugin({ require: '_message_key_wrapper' })
72
-  ];
73
-
74
-  if (isSandbox) {
75
-    // Prevents using `require('evil_loader!mymodule')` to execute custom
76
-    // loader code during the webpack build.
77
-    const RestrictResourcePlugin = require('restrict-resource-webpack-plugin');
78
-    const plugin = new RestrictResourcePlugin(/!+/,
79
-      'Custom inline loaders are not permitted.');
80
-    plugins.push(plugin);
81
-  }
82
-
83
-  return plugins;
84
-})();
85
-
86
-module.exports.module = {
87
-  loaders: (() => {
88
-    const loaders = [{'test': /\.json$/, 'loader': 'json-loader'}];
89
-
90
-    if (isSandbox) {
91
-      // See restricted-resource-loader.js, prevents loading files outside
92
-      // of the project folder, i.e. `require(../../not_your_business)`:
93
-      const restrictLoader = {
94
-        'test': /^.*/, 'loader': 'restricted-resource-loader'
95
-      };
96
-      loaders.push(restrictLoader);
97
-    }
98
-
99
-    return loaders;
100
-  })()
101
-};
Browse code

new VM build

Louis authored on25/11/2018 22:32:17
Showing1 changed files
... ...
@@ -6,7 +6,7 @@ const isSandbox = false;
6 6
 
7 7
 // Array with absolute file path strings
8 8
 const entryFilenames = ["_pkjs_shared_additions.js",
9
-"/home/louis/pebble-dev/projects/synocam_home_switch/src/pkjs/index.js"];
9
+"/home/louis/repos/synocam_home_switch/src/pkjs/index.js"];
10 10
 
11 11
 // folder path string
12 12
 const outputPath = "build";
... ...
@@ -18,10 +18,10 @@ const outputFilename = "pebble-js-app.js";
18 18
 const resolveRoots = ["/home/louis/.pebble-sdk/SDKs/current/sdk-core/pebble/common/include",
19 19
 "/home/louis/.pebble-sdk/SDKs/current/sdk-core/pebble/common/tools/webpack",
20 20
 "/home/louis/.pebble-sdk/SDKs/current/node_modules",
21
-"/home/louis/pebble-dev/projects/synocam_home_switch/build/js"];
21
+"/home/louis/repos/synocam_home_switch/build/js"];
22 22
 
23 23
 // Object, { alias1: 'path1', ... }
24
-const resolveAliases = {"app_package.json": "/home/louis/pebble-dev/projects/synocam_home_switch/package.json",
24
+const resolveAliases = {"app_package.json": "/home/louis/repos/synocam_home_switch/package.json",
25 25
 "pebble-clay": "pebble-clay/dist/js"};
26 26
 
27 27
 // null or Object with key 'sourceMapFilename'
Louis authored on25/08/2018 23:51:28
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,101 @@
1
+////////////////////////////////////////////////////////////////////////////////
2
+// Template vars injected by projess_js.py:
3
+
4
+// boolean
5
+const isSandbox = false;
6
+
7
+// Array with absolute file path strings
8
+const entryFilenames = ["_pkjs_shared_additions.js",
9
+"/home/louis/pebble-dev/projects/synocam_home_switch/src/pkjs/index.js"];
10
+
11
+// folder path string
12
+const outputPath = "build";
13
+
14
+// file name string
15
+const outputFilename = "pebble-js-app.js";
16
+
17
+// Array with absolute folder path strings
18
+const resolveRoots = ["/home/louis/.pebble-sdk/SDKs/current/sdk-core/pebble/common/include",
19
+"/home/louis/.pebble-sdk/SDKs/current/sdk-core/pebble/common/tools/webpack",
20
+"/home/louis/.pebble-sdk/SDKs/current/node_modules",
21
+"/home/louis/pebble-dev/projects/synocam_home_switch/build/js"];
22
+
23
+// Object, { alias1: 'path1', ... }
24
+const resolveAliases = {"app_package.json": "/home/louis/pebble-dev/projects/synocam_home_switch/package.json",
25
+"pebble-clay": "pebble-clay/dist/js"};
26
+
27
+// null or Object with key 'sourceMapFilename'
28
+const sourceMapConfig = {"sourceMapFilename": "pebble-js-app.js.map"};
29
+
30
+////////////////////////////////////////////////////////////////////////////////
31
+// NOTE: Must escape dollar-signs, because this is a Python template!
32
+
33
+const webpack = require('webpack');
34
+
35
+module.exports = (() => {
36
+  // The basic config:
37
+  const config = {
38
+    entry: entryFilenames,
39
+    output: {
40
+        path: outputPath,
41
+        filename: outputFilename
42
+    },
43
+    target: 'node',
44
+    resolve: {
45
+        root: resolveRoots,
46
+        extensions: ['', '.js', '.json'],
47
+        alias: resolveAliases
48
+    },
49
+    resolveLoader: {
50
+        root: resolveRoots
51
+    }
52
+  };
53
+
54
+  if (sourceMapConfig) {
55
+    // Enable webpack's source map output:
56
+    config.devtool = 'source-map';
57
+    config.output.sourceMapFilename = sourceMapConfig.sourceMapFilename;
58
+    config.output.devtoolModuleFilenameTemplate = '[resource-path]';
59
+    config.output.devtoolFallbackModuleFilenameTemplate = '[resourcePath]?[hash]';
60
+  }
61
+
62
+  return config;
63
+})();
64
+
65
+module.exports.plugins = (() => {
66
+  const plugins = [
67
+    // Returns a non-zero exit code when webpack reports an error:
68
+    require('webpack-fail-plugin'),
69
+
70
+    // Includes _message_keys_wrapper in every build to mimic old loader.js:
71
+    new webpack.ProvidePlugin({ require: '_message_key_wrapper' })
72
+  ];
73
+
74
+  if (isSandbox) {
75
+    // Prevents using `require('evil_loader!mymodule')` to execute custom
76
+    // loader code during the webpack build.
77
+    const RestrictResourcePlugin = require('restrict-resource-webpack-plugin');
78
+    const plugin = new RestrictResourcePlugin(/!+/,
79
+      'Custom inline loaders are not permitted.');
80
+    plugins.push(plugin);
81
+  }
82
+
83
+  return plugins;
84
+})();
85
+
86
+module.exports.module = {
87
+  loaders: (() => {
88
+    const loaders = [{'test': /\.json$/, 'loader': 'json-loader'}];
89
+
90
+    if (isSandbox) {
91
+      // See restricted-resource-loader.js, prevents loading files outside
92
+      // of the project folder, i.e. `require(../../not_your_business)`:
93
+      const restrictLoader = {
94
+        'test': /^.*/, 'loader': 'restricted-resource-loader'
95
+      };
96
+      loaders.push(restrictLoader);
97
+    }
98
+
99
+    return loaders;
100
+  })()
101
+};