@cley_faye/boilerplate 4.0.2 → 4.1.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.
@@ -101,7 +101,13 @@ const webpackLoadersDefault = (options) => {
101
101
  loader: "babel-loader",
102
102
  options: {
103
103
  cacheDirectory: true,
104
- plugins: [defaultLoadersDefine(options), ...(options.babel?.plugins ?? [])],
104
+ plugins: [
105
+ defaultLoadersDefine(options),
106
+ ...(options.babel?.plugins ?? [
107
+ "@babel/plugin-syntax-import-attributes",
108
+ "@babel/plugin-transform-runtime",
109
+ ]),
110
+ ],
105
111
  presets: [defaultLoadersPresetEnv(options), defaultLoadersReact(options)],
106
112
  },
107
113
  },
@@ -128,7 +134,9 @@ const webpackLoadersDefault = (options) => {
128
134
  exports.webpackLoadersDefault = webpackLoadersDefault;
129
135
  const computeWebpackOutput = (webpackOptions, targetName) => webpackOptions.output ?? {
130
136
  chunkFilename: "[name]-[fullhash].js",
137
+ chunkFormat: "module",
131
138
  filename: "[name].js",
139
+ module: true,
132
140
  path: (0, path_1.resolve)("dist", targetName, "js"),
133
141
  };
134
142
  const lastNamePosition = 2;
@@ -215,12 +223,23 @@ const handle = (gruntConfig, targetName, webpackOptions) => {
215
223
  const webpackConfig = {
216
224
  devtool: webpackOptions.mode === "development" ? "eval-source-map" : false,
217
225
  entry: webpackEntry,
226
+ experiments: {
227
+ outputModule: true,
228
+ },
218
229
  externals: webpackOptions.externals,
219
230
  mode: webpackOptions.mode,
220
- module: { rules: webpackLoaders },
231
+ module: {
232
+ rules: webpackLoaders,
233
+ parser: {
234
+ javascript: {
235
+ importMeta: false,
236
+ },
237
+ },
238
+ },
221
239
  output: webpackOutput,
222
240
  plugins: getWebpackPlugins(webpackOptions),
223
241
  resolve: webpackResolve,
242
+ target: "web",
224
243
  };
225
244
  // Special case: I'm not sure I can move options in the task-specific part of
226
245
  // the configuration, so I add it at the toplevel of the "webpack" task.
@@ -229,6 +248,6 @@ const handle = (gruntConfig, targetName, webpackOptions) => {
229
248
  }
230
249
  const requiredTasks = registerTasks(gruntConfig, targetName, webpackConfig);
231
250
  const watchTasks = getWatchTasks(webpackOptions, targetName);
232
- return { handledFiles, requiredTasks, watchTasks, };
251
+ return { handledFiles, requiredTasks, watchTasks };
233
252
  };
234
253
  exports.handle = handle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cley_faye/boilerplate",
3
- "version": "4.0.2",
3
+ "version": "4.1.0",
4
4
  "description": "Boilerplate code generator for generic projects",
5
5
  "repository": {
6
6
  "type": "git",