Skip to content

Commit 9987360

Browse files
committed
Add an unnamed chunk test case.
1 parent 755ca63 commit 9987360

4 files changed

Lines changed: 80 additions & 1 deletion

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<root>
3+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
4+
<xsd:element name="root" msdata:IsDataSet="true">
5+
<xsd:complexType>
6+
<xsd:choice maxOccurs="unbounded">
7+
<xsd:element name="metadata">
8+
<xsd:complexType>
9+
<xsd:sequence>
10+
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
11+
</xsd:sequence>
12+
<xsd:attribute name="name" type="xsd:string">
13+
</xsd:attribute>
14+
<xsd:attribute name="type" type="xsd:string">
15+
</xsd:attribute>
16+
<xsd:attribute name="mimetype" type="xsd:string">
17+
</xsd:attribute>
18+
</xsd:complexType>
19+
</xsd:element>
20+
<xsd:element name="assembly">
21+
<xsd:complexType>
22+
<xsd:attribute name="alias" type="xsd:string">
23+
</xsd:attribute>
24+
<xsd:attribute name="name" type="xsd:string">
25+
</xsd:attribute>
26+
</xsd:complexType>
27+
</xsd:element>
28+
<xsd:element name="data">
29+
<xsd:complexType>
30+
<xsd:sequence>
31+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
32+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
33+
</xsd:sequence>
34+
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1">
35+
</xsd:attribute>
36+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3">
37+
</xsd:attribute>
38+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4">
39+
</xsd:attribute>
40+
</xsd:complexType>
41+
</xsd:element>
42+
<xsd:element name="resheader">
43+
<xsd:complexType>
44+
<xsd:sequence>
45+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
46+
</xsd:sequence>
47+
<xsd:attribute name="name" type="xsd:string" use="required">
48+
</xsd:attribute>
49+
</xsd:complexType>
50+
</xsd:element>
51+
</xsd:choice>
52+
</xsd:complexType>
53+
</xsd:element>
54+
</xsd:schema>
55+
<resheader name="resmimetype">
56+
<value>text/microsoft-resx</value>
57+
</resheader>
58+
<data name="string" xml:space="preserve">
59+
<value>RESX string</value>
60+
<comment>RESX string</comment>
61+
</data>
62+
</root>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import strings2 from './strings2.loc.json';
2+
import strings6 from './strings6.resx';
3+
4+
export class UnnamedChunkWithStringsClass {
5+
public doStuff(): void {
6+
console.log(strings2.string1);
7+
console.log(strings6.string);
8+
}
9+
}

build-tests/localization-plugin-test-03/src/indexA.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ import(/* webpackChunkName: 'chunk-without-strings' */ './chunks/chunkWithoutStr
1616
chunk.doStuff();
1717
});
1818

19+
import('./chunks/unnamedChunkWithStrings').then(({ UnnamedChunkWithStringsClass }) => {
20+
const chunk = new UnnamedChunkWithStringsClass();
21+
chunk.doStuff();
22+
});
23+
1924
console.log(strings5.string1);
20-
console.log(strings5.stringWithQuotes);
25+
console.log(strings5.stringWithQuotes);

build-tests/localization-plugin-test-03/webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ module.exports = function(env) {
6666
"./src/strings5.resx": {
6767
"string1": "La primera cadena RESX",
6868
"stringWithQuotes": "\"Cadena RESX con comillas\""
69+
},
70+
".\\src\\chunks\\strings6.resx": {
71+
"string": "cadena RESX"
6972
}
7073
}
7174
},

0 commit comments

Comments
 (0)