@vocab/webpack 1.2.4 → 1.2.6
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/README.md +3 -3
- package/chunk-name/dist/vocab-webpack-chunk-name.cjs.d.ts +1 -0
- package/chunk-name/dist/vocab-webpack-chunk-name.cjs.d.ts.map +1 -0
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/declarations/src/loader.d.ts +1 -1
- package/dist/vocab-webpack.cjs.d.ts +1 -0
- package/dist/vocab-webpack.cjs.d.ts.map +1 -0
- package/loader/dist/vocab-webpack-loader.cjs.d.ts +1 -0
- package/loader/dist/vocab-webpack-loader.cjs.d.ts.map +1 -0
- package/loader/dist/vocab-webpack-loader.cjs.dev.js +3 -4
- package/loader/dist/vocab-webpack-loader.cjs.prod.js +3 -4
- package/loader/dist/vocab-webpack-loader.esm.js +3 -4
- package/package.json +3 -3
- package/web/dist/vocab-webpack-web.cjs.d.ts +1 -0
- package/web/dist/vocab-webpack-web.cjs.d.ts.map +1 -0
- package/dist/declarations/src/logger.d.ts +0 -3
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ $ npm i --save @vocab/core @vocab/react
|
|
|
29
29
|
|
|
30
30
|
### Step 2: Configure Vocab
|
|
31
31
|
|
|
32
|
-
You can configure Vocab directly when calling the API or via a `vocab.config.js` file.
|
|
32
|
+
You can configure Vocab directly when calling the API or via a `vocab.config.js` or `vocab.config.cjs` file.
|
|
33
33
|
|
|
34
34
|
In this example we've configured two languages, English and French, where our initial `translation.json` files will use English.
|
|
35
35
|
|
|
@@ -184,7 +184,7 @@ t('my key with component', {
|
|
|
184
184
|
|
|
185
185
|
## Configuration
|
|
186
186
|
|
|
187
|
-
Configuration can either be passed into the Node API directly or be gathered from the nearest _vocab.config.js_ file.
|
|
187
|
+
Configuration can either be passed into the Node API directly or be gathered from the nearest _vocab.config.js_ or _vocab.config.cjs_ file.
|
|
188
188
|
|
|
189
189
|
**vocab.config.js**
|
|
190
190
|
|
|
@@ -341,7 +341,7 @@ functionality.
|
|
|
341
341
|
|
|
342
342
|
### Generating a pseudo-localized language using Vocab
|
|
343
343
|
|
|
344
|
-
Vocab can generate a pseudo-localized language via the [`generatedLanguages` config][generated languages config], either via the webpack plugin or your `vocab.config.js` file.
|
|
344
|
+
Vocab can generate a pseudo-localized language via the [`generatedLanguages` config][generated languages config], either via the webpack plugin or your `vocab.config.js` or `vocab.config.cjs` file.
|
|
345
345
|
`@vocab/pseudo-localize` exports a `generator` that can be used directly in your config.
|
|
346
346
|
|
|
347
347
|
**vocab.config.js**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab-webpack-chunk-name.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/chunk-name.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type UserConfig } from '@vocab/core';
|
|
2
2
|
import type { LoaderContext as WebpackLoaderContext } from 'webpack';
|
|
3
3
|
type LoaderContext = WebpackLoaderContext<UserConfig>;
|
|
4
4
|
export default function vocabLoader(this: LoaderContext, source: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab-webpack.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab-webpack-loader.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/loader.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var path = require('path');
|
|
6
|
+
var core = require('@vocab/core');
|
|
6
7
|
var cjsModuleLexer = require('cjs-module-lexer');
|
|
7
8
|
var esModuleLexer = require('es-module-lexer');
|
|
8
|
-
var core = require('@vocab/core');
|
|
9
9
|
var chunkName_dist_vocabWebpackChunkName = require('../../chunk-name/dist/vocab-webpack-chunk-name.cjs.dev.js');
|
|
10
10
|
var logger = require('../../dist/logger-65149486.cjs.dev.js');
|
|
11
11
|
require('chalk');
|
|
@@ -61,7 +61,7 @@ function stringifyRequest(request) {
|
|
|
61
61
|
function renderLanguageLoaderAsync(resourcePath, loadedTranslation) {
|
|
62
62
|
return lang => {
|
|
63
63
|
const identifier = stringifyRequest.call(this, createIdentifier(lang, resourcePath, loadedTranslation));
|
|
64
|
-
return
|
|
64
|
+
return /* ts */`
|
|
65
65
|
createLanguage(
|
|
66
66
|
require.resolveWeak(${identifier}),
|
|
67
67
|
() => import(
|
|
@@ -69,8 +69,7 @@ function renderLanguageLoaderAsync(resourcePath, loadedTranslation) {
|
|
|
69
69
|
${identifier}
|
|
70
70
|
)
|
|
71
71
|
)
|
|
72
|
-
`.trim()
|
|
73
|
-
);
|
|
72
|
+
`.trim();
|
|
74
73
|
};
|
|
75
74
|
}
|
|
76
75
|
function findExportNames(source, mode) {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var path = require('path');
|
|
6
|
+
var core = require('@vocab/core');
|
|
6
7
|
var cjsModuleLexer = require('cjs-module-lexer');
|
|
7
8
|
var esModuleLexer = require('es-module-lexer');
|
|
8
|
-
var core = require('@vocab/core');
|
|
9
9
|
var chunkName_dist_vocabWebpackChunkName = require('../../chunk-name/dist/vocab-webpack-chunk-name.cjs.prod.js');
|
|
10
10
|
var logger = require('../../dist/logger-f79e34a8.cjs.prod.js');
|
|
11
11
|
require('chalk');
|
|
@@ -61,7 +61,7 @@ function stringifyRequest(request) {
|
|
|
61
61
|
function renderLanguageLoaderAsync(resourcePath, loadedTranslation) {
|
|
62
62
|
return lang => {
|
|
63
63
|
const identifier = stringifyRequest.call(this, createIdentifier(lang, resourcePath, loadedTranslation));
|
|
64
|
-
return
|
|
64
|
+
return /* ts */`
|
|
65
65
|
createLanguage(
|
|
66
66
|
require.resolveWeak(${identifier}),
|
|
67
67
|
() => import(
|
|
@@ -69,8 +69,7 @@ function renderLanguageLoaderAsync(resourcePath, loadedTranslation) {
|
|
|
69
69
|
${identifier}
|
|
70
70
|
)
|
|
71
71
|
)
|
|
72
|
-
`.trim()
|
|
73
|
-
);
|
|
72
|
+
`.trim();
|
|
74
73
|
};
|
|
75
74
|
}
|
|
76
75
|
function findExportNames(source, mode) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
+
import { getDevLanguageFileFromTsFile, loadTranslation } from '@vocab/core';
|
|
2
3
|
import * as cjsModuleLexer from 'cjs-module-lexer';
|
|
3
4
|
import * as esModuleLexer from 'es-module-lexer';
|
|
4
|
-
import { getDevLanguageFileFromTsFile, loadTranslation } from '@vocab/core';
|
|
5
5
|
import { getChunkName } from '../../chunk-name/dist/vocab-webpack-chunk-name.esm.js';
|
|
6
6
|
import { t as trace$1 } from '../../dist/logger-e1862ea1.esm.js';
|
|
7
7
|
import 'chalk';
|
|
@@ -33,7 +33,7 @@ function stringifyRequest(request) {
|
|
|
33
33
|
function renderLanguageLoaderAsync(resourcePath, loadedTranslation) {
|
|
34
34
|
return lang => {
|
|
35
35
|
const identifier = stringifyRequest.call(this, createIdentifier(lang, resourcePath, loadedTranslation));
|
|
36
|
-
return
|
|
36
|
+
return /* ts */`
|
|
37
37
|
createLanguage(
|
|
38
38
|
require.resolveWeak(${identifier}),
|
|
39
39
|
() => import(
|
|
@@ -41,8 +41,7 @@ function renderLanguageLoaderAsync(resourcePath, loadedTranslation) {
|
|
|
41
41
|
${identifier}
|
|
42
42
|
)
|
|
43
43
|
)
|
|
44
|
-
`.trim()
|
|
45
|
-
);
|
|
44
|
+
`.trim();
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
47
|
function findExportNames(source, mode) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vocab/webpack",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"main": "dist/vocab-webpack.cjs.js",
|
|
5
5
|
"module": "dist/vocab-webpack.esm.js",
|
|
6
6
|
"exports": {
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"web"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@vocab/core": "^1.
|
|
42
|
+
"@vocab/core": "^1.6.0",
|
|
43
43
|
"chalk": "^4.1.0",
|
|
44
44
|
"cjs-module-lexer": "^1.2.2",
|
|
45
45
|
"debug": "^4.3.1",
|
|
46
|
-
"es-module-lexer": "^0.
|
|
46
|
+
"es-module-lexer": "^0.10.0",
|
|
47
47
|
"virtual-resource-loader": "^1.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab-webpack-web.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/web.d.ts"],"names":[],"mappings":"AAAA"}
|