@intlayer/webpack 8.4.0 → 8.4.2
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/dist/cjs/getEntries.cjs +1 -1
- package/dist/cjs/getEntries.cjs.map +1 -1
- package/dist/cjs/utils-DLoAEeUK.cjs +2 -0
- package/dist/cjs/utils-DLoAEeUK.cjs.map +1 -0
- package/dist/cjs/utils.cjs +1 -2
- package/dist/cjs/webpack-plugin.cjs +1 -1
- package/dist/cjs/webpack-plugin.cjs.map +1 -1
- package/dist/cjs/webpack.config.cjs +1 -1
- package/dist/cjs/webpack.config.cjs.map +1 -1
- package/dist/esm/getEntries.mjs +1 -1
- package/dist/esm/getEntries.mjs.map +1 -1
- package/dist/esm/utils-BDXyibK-.mjs +2 -0
- package/dist/esm/utils-BDXyibK-.mjs.map +1 -0
- package/dist/esm/utils.mjs +1 -2
- package/dist/esm/webpack.config.mjs +1 -1
- package/dist/esm/webpack.config.mjs.map +1 -1
- package/dist/types/getEntries.d.ts +1 -1
- package/dist/types/getEntries.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/cjs/utils.cjs.map +0 -1
- package/dist/esm/_virtual/_rolldown/runtime.mjs +0 -1
- package/dist/esm/utils.mjs.map +0 -1
package/dist/cjs/getEntries.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./utils-DLoAEeUK.cjs`);let e=require(`@intlayer/chokidar/listDictionaries`),t=require(`@intlayer/chokidar/utils`);const n=async n=>(await(0,e.listDictionaries)(n)).reduce((e,n)=>{let r=(0,t.getPathHash)(n);return e[`intlayer-content/${r}`]={import:n,dependOn:void 0},e},{});exports.getEntries=n;
|
|
2
2
|
//# sourceMappingURL=getEntries.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEntries.cjs","names":[
|
|
1
|
+
{"version":3,"file":"getEntries.cjs","names":[],"sources":["../../src/getEntries.ts"],"sourcesContent":["import { listDictionaries } from '@intlayer/chokidar/listDictionaries';\nimport { getPathHash } from '@intlayer/chokidar/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { EntryObject } from 'webpack';\n\nexport const getEntries = async (\n configuration: IntlayerConfig\n): Promise<EntryObject> => {\n const files = await listDictionaries(configuration);\n\n return files.reduce((obj, el) => {\n const hash = getPathHash(el);\n\n obj[`intlayer-content/${hash}`] = {\n import: el,\n dependOn: undefined,\n };\n\n return obj;\n }, {} as EntryObject);\n};\n"],"mappings":"8LAKA,MAAa,EAAa,KACxB,KAEc,MAAA,EAAA,EAAA,kBAAuB,EAAc,EAEtC,QAAQ,EAAK,IAAO,CAC/B,IAAM,GAAA,EAAA,EAAA,aAAmB,EAAG,CAO5B,MALA,GAAI,oBAAoB,KAAU,CAChC,OAAQ,EACR,SAAU,IAAA,GACX,CAEM,GACN,EAAE,CAAgB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`node:path`);c=s(c);let l=require(`node:url`),u=require(`@intlayer/config/utils`);const d=()=>{let e=u.isESModule?(0,l.fileURLToPath)(require(`url`).pathToFileURL(__filename).href):require(`node:url`).pathToFileURL(__filename).toString();globalThis.__filename=globalThis.__filename??e,globalThis.__dirname=globalThis.__dirname??c.default.dirname(__filename)};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
|
|
2
|
+
//# sourceMappingURL=utils-DLoAEeUK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-DLoAEeUK.cjs","names":["isESModule","path"],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":"8jBAOA,MAAa,MAAsB,CACjC,IAAM,EAAWA,EAAAA,YAAAA,EAAAA,EAAAA,eAAAA,QAAAA,MAAAA,CAAAA,cAAAA,WAAAA,CAAAA,KACiB,CAC9B,QAAQ,WAAW,CAAC,cAAc,WAAW,CAAC,UAAU,CAE5D,WAAW,WAAa,WAAW,YAAc,EACjD,WAAW,UAAY,WAAW,WAAaC,EAAAA,QAAK,QAAQ,WAAW"}
|
package/dist/cjs/utils.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
2
|
-
//# sourceMappingURL=utils.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./utils-DLoAEeUK.cjs`);exports.defineDirname=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./utils-DLoAEeUK.cjs`);let e=require(`@intlayer/chokidar/build`),t=require(`@intlayer/chokidar/watcher`),n=require(`@intlayer/config/logger`);var r=class{isWatching=!1;configuration;constructor(e){this.configuration=e}async apply(r){this.configuration.content.watch&&(0,t.watch)({configuration:this.configuration}),r.hooks.beforeCompile.tapPromise(`IntlayerPlugin`,async()=>{if(!this.isWatching)try{await(0,e.prepareIntlayer)(this.configuration),this.isWatching=!0}catch(e){(0,n.logger)(`Error in IntlayerPlugin: ${e}`,{level:`error`})}})}};exports.IntlayerPlugin=r;
|
|
2
2
|
//# sourceMappingURL=webpack-plugin.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-plugin.cjs","names":[],"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { logger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Compiler } from 'webpack';\n\n// Watch mode or on time build\nexport class IntlayerPlugin {\n private isWatching = false; // Flag to ensure we only start the watcher after the first build\n private configuration;\n\n constructor(configuration: IntlayerConfig) {\n this.configuration = configuration;\n }\n\n async apply(compiler: Compiler): Promise<void> {\n if (this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n watch({ configuration: this.configuration });\n }\n\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n if (!this.isWatching) {\n try {\n await prepareIntlayer(this.configuration);\n this.isWatching = true;\n } catch (error) {\n logger(`Error in IntlayerPlugin: ${error}`, {\n level: 'error',\n });\n }\n }\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack-plugin.cjs","names":[],"sources":["../../src/webpack-plugin.ts"],"sourcesContent":["import { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { logger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Compiler } from 'webpack';\n\n// Watch mode or on time build\nexport class IntlayerPlugin {\n private isWatching = false; // Flag to ensure we only start the watcher after the first build\n private configuration;\n\n constructor(configuration: IntlayerConfig) {\n this.configuration = configuration;\n }\n\n async apply(compiler: Compiler): Promise<void> {\n if (this.configuration.content.watch) {\n // Start watching (assuming watch is also async)\n watch({ configuration: this.configuration });\n }\n\n compiler.hooks.beforeCompile.tapPromise('IntlayerPlugin', async () => {\n if (!this.isWatching) {\n try {\n await prepareIntlayer(this.configuration);\n this.isWatching = true;\n } catch (error) {\n logger(`Error in IntlayerPlugin: ${error}`, {\n level: 'error',\n });\n }\n }\n });\n }\n}\n"],"mappings":"0NAOA,IAAa,EAAb,KAA4B,CAC1B,WAAqB,GACrB,cAEA,YAAY,EAA+B,CACzC,KAAK,cAAgB,EAGvB,MAAM,MAAM,EAAmC,CACzC,KAAK,cAAc,QAAQ,QAE7B,EAAA,EAAA,OAAM,CAAE,cAAe,KAAK,cAAe,CAAC,CAG9C,EAAS,MAAM,cAAc,WAAW,iBAAkB,SAAY,CACpE,GAAI,CAAC,KAAK,WACR,GAAI,CACF,MAAA,EAAA,EAAA,iBAAsB,KAAK,cAAc,CACzC,KAAK,WAAa,SACX,EAAO,EACd,EAAA,EAAA,QAAO,4BAA4B,IAAS,CAC1C,MAAO,QACR,CAAC,GAGN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}})
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./utils-DLoAEeUK.cjs`),t=require(`./getEntries.cjs`),n=require(`./webpack-plugin.cjs`);let r=require(`node:path`),i=require(`@intlayer/config/node`);const a={hot:!0,open:!1,liveReload:!1,compress:!0,historyApiFallback:!1,host:`localhost`,port:8080,watchFiles:`./src/`,devMiddleware:{writeToDisk:!0},static:{}},o=(o=(0,i.getConfiguration)())=>{let{fileExtensions:s}=o.content;return e.t(),{mode:`production`,target:`node`,entry:()=>t.getEntries(o),output:{clean:!0,library:`IntlLayerContent`,libraryTarget:`umd`,filename:`[name].bundle.js`},cache:!1,devtool:`source-map`,ignoreWarnings:[/./],resolve:{extensions:[`.ts`,`.js`,`.json`,`.wasm`,`.ts`,`.tsx`,`.mjs`,`.cjs`],modules:[(0,r.join)(globalThis.__dirname,`..`,`node_modules`),(0,r.join)(process.cwd(),`node_modules`),(0,r.join)(process.cwd(),`node_modules`,`intlayer-cli`,`node_modules`),(0,r.join)(process.cwd(),`node_modules`,`intlayer-cli`,`node_modules`,`@intlayer/webpack`,`node_modules`)]},resolveLoader:{modules:[(0,r.join)(process.cwd(),`node_modules`),(0,r.join)(process.cwd(),`node_modules`,`@intlayer/webpack`,`node_modules`),(0,r.join)(process.cwd(),`node_modules`,`intlayer-cli`,`node_modules`,`@intlayer/webpack`,`node_modules`)]},module:{rules:[{test:RegExp(`(${s.join(`|`)})$`),use:[{loader:`esbuild-loader`,options:{target:`es2015`}}]},{test:/\.node$/,loader:`node-loader`},{test:/\.(jsx|js|ts|tsx|mjs|cjs)?$/,loader:`esbuild-loader`,options:{target:`es2015`}}]},devServer:a,plugins:[new n.IntlayerPlugin(o)]}};exports.default=o,exports.getWebpackConfig=o,exports.devServerConfig=a;
|
|
2
2
|
//# sourceMappingURL=webpack.config.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.config.cjs","names":["getEntries","IntlayerPlugin"],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', //
|
|
1
|
+
{"version":3,"file":"webpack.config.cjs","names":["getEntries","IntlayerPlugin"],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', // derived from content.fileExtensions + content.contentDir\n\n devMiddleware: {\n // Enable write to disk to reuse the output\n writeToDisk: true,\n },\n\n // Content base\n static: {},\n};\n\nexport const getWebpackConfig = (\n configuration: IntlayerConfig = getConfiguration()\n): WebPackConfiguration => {\n const { fileExtensions } = configuration.content;\n\n /**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\n defineDirname();\n\n const webpackConfig: WebPackConfiguration = {\n // Define the environment mode (development or production)\n mode: 'production', // or 'production'\n // Entry point of the application\n target: 'node', // Specifies the target environment\n\n entry: () => getEntries(configuration),\n output: {\n clean: true, // Clean the output directory before emit\n library: 'IntlLayerContent',\n libraryTarget: 'umd',\n filename: `[name].bundle.js`,\n },\n\n cache: false,\n\n devtool: 'source-map',\n\n // stats: {\n // preset: 'errors-only',\n // warnings: false,\n // },\n ignoreWarnings: [/./],\n resolve: {\n // Resolve TypeScript, JavaScript and JSON files\n extensions: [\n '.ts',\n '.js',\n '.json',\n '.wasm',\n '.ts',\n '.tsx',\n '.mjs',\n '.cjs',\n ],\n modules: [\n // To find the loader module\n join(globalThis.__dirname, '..', 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', 'intlayer-cli', 'node_modules'), // Or via another project by importing intlayer\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n resolveLoader: {\n // Configure how Webpack finds `loader` modules.\n modules: [\n // To find the loader module\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(\n process.cwd(),\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing @intlayer/webpack\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n module: {\n rules: [\n {\n // Rule for .content.ts files\n test: new RegExp(`(${fileExtensions.join('|')})$`),\n use: [\n {\n // Transpile with esbuild-loader\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n // {\n // // Custom loader to process the transpiled code\n // loader: resolve('./intlayer-loader'),\n // },\n ],\n },\n {\n test: /\\.node$/,\n loader: 'node-loader',\n },\n // Use esbuild to compile JavaScript & TypeScript\n {\n // Match `.js`, `.jsx`, `.ts` or `.tsx` files\n test: /\\.(jsx|js|ts|tsx|mjs|cjs)?$/,\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n\n // JSON files are supported natively by Webpack 5, no specific loader required\n ],\n },\n devServer: devServerConfig,\n\n plugins: [new IntlayerPlugin(configuration)],\n };\n\n return webpackConfig;\n};\n\nexport default getWebpackConfig;\n"],"mappings":"qQAWA,MAAa,EAA0C,CAErD,IAAK,GAEL,KAAM,GACN,WAAY,GAGZ,SAAU,GAGV,mBAAoB,GAGpB,KAAM,YACN,KAAM,KAEN,WAAY,SAEZ,cAAe,CAEb,YAAa,GACd,CAGD,OAAQ,EAAE,CACX,CAEY,GACX,GAAA,EAAA,EAAA,mBAAkD,GACzB,CACzB,GAAM,CAAE,kBAAmB,EAAc,QA2HzC,OAtHA,EAAA,GAAe,CAE6B,CAE1C,KAAM,aAEN,OAAQ,OAER,UAAaA,EAAAA,WAAW,EAAc,CACtC,OAAQ,CACN,MAAO,GACP,QAAS,mBACT,cAAe,MACf,SAAU,mBACX,CAED,MAAO,GAEP,QAAS,aAMT,eAAgB,CAAC,IAAI,CACrB,QAAS,CAEP,WAAY,CACV,MACA,MACA,QACA,QACA,MACA,OACA,OACA,OACD,CACD,QAAS,YAEF,WAAW,UAAW,KAAM,eAAe,YAC3C,QAAQ,KAAK,CAAE,eAAe,YAC9B,QAAQ,KAAK,CAAE,eAAgB,eAAgB,eAAe,YAEjE,QAAQ,KAAK,CACb,eACA,eACA,eACA,oBACA,eACD,CACF,CACF,CAED,cAAe,CAEb,QAAS,YAEF,QAAQ,KAAK,CAAE,eAAe,YAEjC,QAAQ,KAAK,CACb,eACA,oBACA,eACD,YAEC,QAAQ,KAAK,CACb,eACA,eACA,eACA,oBACA,eACD,CACF,CACF,CAED,OAAQ,CACN,MAAO,CACL,CAEE,KAAU,OAAO,IAAI,EAAe,KAAK,IAAI,CAAC,IAAI,CAClD,IAAK,CACH,CAEE,OAAQ,iBACR,QAAS,CAEP,OAAQ,SACT,CACF,CAKF,CACF,CACD,CACE,KAAM,UACN,OAAQ,cACT,CAED,CAEE,KAAM,8BACN,OAAQ,iBACR,QAAS,CAEP,OAAQ,SACT,CACF,CAGF,CACF,CACD,UAAW,EAEX,QAAS,CAAC,IAAIC,EAAAA,eAAe,EAAc,CAAC,CAC7C"}
|
package/dist/esm/getEntries.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{listDictionaries as e}from"@intlayer/chokidar/listDictionaries";import{getPathHash as t}from"@intlayer/chokidar/utils";const n=async n=>(await e(n)).reduce((e,n)=>{let r=t(n);return e[`intlayer-content/${r}`]={import:n,dependOn:void 0},e},{});export{n as getEntries};
|
|
2
2
|
//# sourceMappingURL=getEntries.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEntries.mjs","names":[],"sources":["../../src/getEntries.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getEntries.mjs","names":[],"sources":["../../src/getEntries.ts"],"sourcesContent":["import { listDictionaries } from '@intlayer/chokidar/listDictionaries';\nimport { getPathHash } from '@intlayer/chokidar/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { EntryObject } from 'webpack';\n\nexport const getEntries = async (\n configuration: IntlayerConfig\n): Promise<EntryObject> => {\n const files = await listDictionaries(configuration);\n\n return files.reduce((obj, el) => {\n const hash = getPathHash(el);\n\n obj[`intlayer-content/${hash}`] = {\n import: el,\n dependOn: undefined,\n };\n\n return obj;\n }, {} as EntryObject);\n};\n"],"mappings":"8HAKA,MAAa,EAAa,KACxB,KAEc,MAAM,EAAiB,EAAc,EAEtC,QAAQ,EAAK,IAAO,CAC/B,IAAM,EAAO,EAAY,EAAG,CAO5B,MALA,GAAI,oBAAoB,KAAU,CAChC,OAAQ,EACR,SAAU,IAAA,GACX,CAEM,GACN,EAAE,CAAgB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"node:path";import{fileURLToPath as t}from"node:url";import{isESModule as n}from"@intlayer/config/utils";var r=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const i=()=>{let i=n?t(import.meta.url):r(`node:url`).pathToFileURL(__filename).toString();globalThis.__filename=globalThis.__filename??i,globalThis.__dirname=globalThis.__dirname??e.dirname(__filename)};export{i as t};
|
|
2
|
+
//# sourceMappingURL=utils-BDXyibK-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-BDXyibK-.mjs","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":"yfAOA,MAAa,MAAsB,CACjC,IAAM,EAAW,EACb,EAAc,OAAO,KAAK,IAAI,CAAA,EACtB,WAAW,CAAC,cAAc,WAAW,CAAC,UAAU,CAE5D,WAAW,WAAa,WAAW,YAAc,EACjD,WAAW,UAAY,WAAW,WAAa,EAAK,QAAQ,WAAW"}
|
package/dist/esm/utils.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=utils.mjs.map
|
|
1
|
+
import{t as e}from"./utils-BDXyibK-.mjs";export{e as defineDirname};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"./utils-BDXyibK-.mjs";import{getEntries as t}from"./getEntries.mjs";import{IntlayerPlugin as n}from"./webpack-plugin.mjs";import{join as r}from"node:path";import{getConfiguration as i}from"@intlayer/config/node";const a={hot:!0,open:!1,liveReload:!1,compress:!0,historyApiFallback:!1,host:`localhost`,port:8080,watchFiles:`./src/`,devMiddleware:{writeToDisk:!0},static:{}},o=(o=i())=>{let{fileExtensions:s}=o.content;return e(),{mode:`production`,target:`node`,entry:()=>t(o),output:{clean:!0,library:`IntlLayerContent`,libraryTarget:`umd`,filename:`[name].bundle.js`},cache:!1,devtool:`source-map`,ignoreWarnings:[/./],resolve:{extensions:[`.ts`,`.js`,`.json`,`.wasm`,`.ts`,`.tsx`,`.mjs`,`.cjs`],modules:[r(globalThis.__dirname,`..`,`node_modules`),r(process.cwd(),`node_modules`),r(process.cwd(),`node_modules`,`intlayer-cli`,`node_modules`),r(process.cwd(),`node_modules`,`intlayer-cli`,`node_modules`,`@intlayer/webpack`,`node_modules`)]},resolveLoader:{modules:[r(process.cwd(),`node_modules`),r(process.cwd(),`node_modules`,`@intlayer/webpack`,`node_modules`),r(process.cwd(),`node_modules`,`intlayer-cli`,`node_modules`,`@intlayer/webpack`,`node_modules`)]},module:{rules:[{test:RegExp(`(${s.join(`|`)})$`),use:[{loader:`esbuild-loader`,options:{target:`es2015`}}]},{test:/\.node$/,loader:`node-loader`},{test:/\.(jsx|js|ts|tsx|mjs|cjs)?$/,loader:`esbuild-loader`,options:{target:`es2015`}}]},devServer:a,plugins:[new n(o)]}};export{o as default,o as getWebpackConfig,a as devServerConfig};
|
|
2
2
|
//# sourceMappingURL=webpack.config.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.config.mjs","names":[],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', //
|
|
1
|
+
{"version":3,"file":"webpack.config.mjs","names":[],"sources":["../../src/webpack.config.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n// @ts-ignore - Export exists\nimport type { Configuration as WebPackConfiguration } from 'webpack';\nimport type { Configuration as DevServerConfiguration } from 'webpack-dev-server';\nimport { getEntries } from './getEntries';\nimport { defineDirname } from './utils';\nimport { IntlayerPlugin } from './webpack-plugin';\n\n// For web interface\nexport const devServerConfig: DevServerConfiguration = {\n // Enable hot module replacement\n hot: true,\n // Open the browser\n open: false,\n liveReload: false,\n\n // Enable compression\n compress: true,\n\n // History API fallback\n historyApiFallback: false,\n\n // Host and port\n host: 'localhost',\n port: 8080,\n\n watchFiles: './src/', // derived from content.fileExtensions + content.contentDir\n\n devMiddleware: {\n // Enable write to disk to reuse the output\n writeToDisk: true,\n },\n\n // Content base\n static: {},\n};\n\nexport const getWebpackConfig = (\n configuration: IntlayerConfig = getConfiguration()\n): WebPackConfiguration => {\n const { fileExtensions } = configuration.content;\n\n /**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\n defineDirname();\n\n const webpackConfig: WebPackConfiguration = {\n // Define the environment mode (development or production)\n mode: 'production', // or 'production'\n // Entry point of the application\n target: 'node', // Specifies the target environment\n\n entry: () => getEntries(configuration),\n output: {\n clean: true, // Clean the output directory before emit\n library: 'IntlLayerContent',\n libraryTarget: 'umd',\n filename: `[name].bundle.js`,\n },\n\n cache: false,\n\n devtool: 'source-map',\n\n // stats: {\n // preset: 'errors-only',\n // warnings: false,\n // },\n ignoreWarnings: [/./],\n resolve: {\n // Resolve TypeScript, JavaScript and JSON files\n extensions: [\n '.ts',\n '.js',\n '.json',\n '.wasm',\n '.ts',\n '.tsx',\n '.mjs',\n '.cjs',\n ],\n modules: [\n // To find the loader module\n join(globalThis.__dirname, '..', 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(process.cwd(), 'node_modules', 'intlayer-cli', 'node_modules'), // Or via another project by importing intlayer\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n resolveLoader: {\n // Configure how Webpack finds `loader` modules.\n modules: [\n // To find the loader module\n join(process.cwd(), 'node_modules'), // In the project node_modules\n join(\n process.cwd(),\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing @intlayer/webpack\n join(\n process.cwd(),\n 'node_modules',\n 'intlayer-cli',\n 'node_modules',\n '@intlayer/webpack',\n 'node_modules'\n ), // Or via another project by importing intlayer\n ],\n },\n\n module: {\n rules: [\n {\n // Rule for .content.ts files\n test: new RegExp(`(${fileExtensions.join('|')})$`),\n use: [\n {\n // Transpile with esbuild-loader\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n // {\n // // Custom loader to process the transpiled code\n // loader: resolve('./intlayer-loader'),\n // },\n ],\n },\n {\n test: /\\.node$/,\n loader: 'node-loader',\n },\n // Use esbuild to compile JavaScript & TypeScript\n {\n // Match `.js`, `.jsx`, `.ts` or `.tsx` files\n test: /\\.(jsx|js|ts|tsx|mjs|cjs)?$/,\n loader: 'esbuild-loader',\n options: {\n // JavaScript version to compile to\n target: 'es2015',\n },\n },\n\n // JSON files are supported natively by Webpack 5, no specific loader required\n ],\n },\n devServer: devServerConfig,\n\n plugins: [new IntlayerPlugin(configuration)],\n };\n\n return webpackConfig;\n};\n\nexport default getWebpackConfig;\n"],"mappings":"uOAWA,MAAa,EAA0C,CAErD,IAAK,GAEL,KAAM,GACN,WAAY,GAGZ,SAAU,GAGV,mBAAoB,GAGpB,KAAM,YACN,KAAM,KAEN,WAAY,SAEZ,cAAe,CAEb,YAAa,GACd,CAGD,OAAQ,EAAE,CACX,CAEY,GACX,EAAgC,GAAkB,GACzB,CACzB,GAAM,CAAE,kBAAmB,EAAc,QA2HzC,OAtHA,GAAe,CAE6B,CAE1C,KAAM,aAEN,OAAQ,OAER,UAAa,EAAW,EAAc,CACtC,OAAQ,CACN,MAAO,GACP,QAAS,mBACT,cAAe,MACf,SAAU,mBACX,CAED,MAAO,GAEP,QAAS,aAMT,eAAgB,CAAC,IAAI,CACrB,QAAS,CAEP,WAAY,CACV,MACA,MACA,QACA,QACA,MACA,OACA,OACA,OACD,CACD,QAAS,CAEP,EAAK,WAAW,UAAW,KAAM,eAAe,CAChD,EAAK,QAAQ,KAAK,CAAE,eAAe,CACnC,EAAK,QAAQ,KAAK,CAAE,eAAgB,eAAgB,eAAe,CACnE,EACE,QAAQ,KAAK,CACb,eACA,eACA,eACA,oBACA,eACD,CACF,CACF,CAED,cAAe,CAEb,QAAS,CAEP,EAAK,QAAQ,KAAK,CAAE,eAAe,CACnC,EACE,QAAQ,KAAK,CACb,eACA,oBACA,eACD,CACD,EACE,QAAQ,KAAK,CACb,eACA,eACA,eACA,oBACA,eACD,CACF,CACF,CAED,OAAQ,CACN,MAAO,CACL,CAEE,KAAU,OAAO,IAAI,EAAe,KAAK,IAAI,CAAC,IAAI,CAClD,IAAK,CACH,CAEE,OAAQ,iBACR,QAAS,CAEP,OAAQ,SACT,CACF,CAKF,CACF,CACD,CACE,KAAM,UACN,OAAQ,cACT,CAED,CAEE,KAAM,8BACN,OAAQ,iBACR,QAAS,CAEP,OAAQ,SACT,CACF,CAGF,CACF,CACD,UAAW,EAEX,QAAS,CAAC,IAAI,EAAe,EAAc,CAAC,CAC7C"}
|
|
@@ -2,7 +2,7 @@ import { IntlayerConfig } from "@intlayer/types/config";
|
|
|
2
2
|
import { EntryObject } from "webpack";
|
|
3
3
|
|
|
4
4
|
//#region src/getEntries.d.ts
|
|
5
|
-
declare const getEntries: (configuration: IntlayerConfig) => EntryObject
|
|
5
|
+
declare const getEntries: (configuration: IntlayerConfig) => Promise<EntryObject>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { getEntries };
|
|
8
8
|
//# sourceMappingURL=getEntries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEntries.d.ts","names":[],"sources":["../../src/getEntries.ts"],"mappings":";;;;cAKa,UAAA,
|
|
1
|
+
{"version":3,"file":"getEntries.d.ts","names":[],"sources":["../../src/getEntries.ts"],"mappings":";;;;cAKa,UAAA,GACX,aAAA,EAAe,cAAA,KACd,OAAA,CAAQ,WAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/webpack",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Webpack plugin for seamless integration with Intlayer, enhancing JavaScript apps built with React, Next.js and more.",
|
|
6
6
|
"keywords": [
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"watch": "webpack --config ./webpack.config.ts --watch"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@intlayer/chokidar": "8.4.
|
|
81
|
-
"@intlayer/config": "8.4.
|
|
82
|
-
"@intlayer/types": "8.4.
|
|
80
|
+
"@intlayer/chokidar": "8.4.2",
|
|
81
|
+
"@intlayer/config": "8.4.2",
|
|
82
|
+
"@intlayer/types": "8.4.2",
|
|
83
83
|
"fast-glob": "3.3.3",
|
|
84
84
|
"webpack": "5.105.4",
|
|
85
85
|
"webpack-dev-server": "5.2.3"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
|
package/dist/cjs/utils.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","names":["isESModule","path"],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":"+NAOA,MAAa,MAAsB,CACjC,IAAM,EAAWA,EAAAA,YAAAA,EAAAA,EAAAA,eAAAA,QAAAA,MAAAA,CAAAA,cAAAA,WAAAA,CAAAA,KACiB,CAC9B,QAAQ,WAAW,CAAC,cAAc,WAAW,CAAC,UAAU,CAE5D,WAAW,WAAa,WAAW,YAAc,EACjD,WAAW,UAAY,WAAW,WAAaC,EAAAA,QAAK,QAAQ,WAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});export{e as __require};
|
package/dist/esm/utils.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\n/**\n * Set the __dirname global variable to make the config work in both ESM and CJS environments\n */\nexport const defineDirname = () => {\n const filename = isESModule\n ? fileURLToPath(import.meta.url)\n : require('node:url').pathToFileURL(__filename).toString();\n\n globalThis.__filename = globalThis.__filename ?? filename;\n globalThis.__dirname = globalThis.__dirname ?? path.dirname(__filename);\n};\n"],"mappings":"mLAOA,MAAa,MAAsB,CACjC,IAAM,EAAW,EACb,EAAc,OAAO,KAAK,IAAI,CAAA,EACtB,WAAW,CAAC,cAAc,WAAW,CAAC,UAAU,CAE5D,WAAW,WAAa,WAAW,YAAc,EACjD,WAAW,UAAY,WAAW,WAAa,EAAK,QAAQ,WAAW"}
|