@npm-questionpro/wick-ui-i18n 0.5.0 → 0.6.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.
Files changed (2) hide show
  1. package/index.js +13 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -157,6 +157,19 @@ export default function wickuiI18nPlugin(options = {}) {
157
157
  : null;
158
158
  },
159
159
 
160
+ buildStart() {
161
+ processor.dictionary.clear();
162
+ },
163
+
164
+ configureServer(server) {
165
+ server.middlewares.use("/wick-ui-i18n.json", (req, res) => {
166
+ res.setHeader("Content-Type", "application/json");
167
+ res.end(
168
+ JSON.stringify(Object.fromEntries(processor.dictionary), null, 2),
169
+ );
170
+ });
171
+ },
172
+
160
173
  generateBundle() {
161
174
  this.emitFile({
162
175
  type: "asset",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm-questionpro/wick-ui-i18n",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "license": "ISC",
5
5
  "description": "Auto-translation AST wrapper for Wick UI",
6
6
  "type": "module",