Skip to content

Commit f91b8f8

Browse files
author
JC
committed
fix issue #9 #8
1 parent 85420d5 commit f91b8f8

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ const extract = (src, __webpack_public_path__) => {
2929
};
3030

3131
const defaultMinimizeConf = {
32+
caseSensitive: true,
3233
html5: true,
3334
removeComments: true,
3435
removeCommentsFromCDATA: true,
3536
removeCDATASectionsFromCDATA: true,
3637
collapseWhitespace: true,
37-
collapseBooleanAttributes: true,
3838
removeRedundantAttributes: true,
3939
removeEmptyAttributes: true,
4040
keepClosingSlash: true,

test/test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,26 @@ describe('wxml-loader', () => {
114114
const result = readFile();
115115
expect(result).toBe('<span><div></div></span>');
116116
});
117+
118+
test('should minimize work with camelCase attribute', async () => {
119+
const code = '<div nickName="name"></div>';
120+
await compile(code, { minimize: true });
121+
const result = readFile();
122+
expect(result).toBe('<div nickName="name"></div>');
123+
});
124+
125+
test('should minimize work with form attribute', async () => {
126+
const code = '<form bindsubmit="submitForm" report-submit="true">';
127+
await compile(code, { minimize: true });
128+
const result = readFile();
129+
expect(result).toBe('<form bindsubmit="submitForm" report-submit="true"></form>');
130+
});
131+
132+
test('should minimize work with controls attribute', async () => {
133+
const code = '<map id="map" controls="{{controls}}"></map>';
134+
await compile(code, { minimize: true });
135+
const result = readFile();
136+
expect(result).toBe('<map id="map" controls="{{controls}}"></map>');
137+
});
138+
117139
});

0 commit comments

Comments
 (0)