Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 3fe2d12

Browse files
jungomimichael-ciniawsky
authored andcommitted
fix: remove = from default export (SyntaxError) (#178)
1 parent b47224a commit 3fe2d12

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default function fileLoader(content) {
7575
this.emitFile(outputPath, content);
7676
}
7777

78-
return `export default = ${publicPath};`;
78+
return `export default ${publicPath};`;
7979
}
8080

8181
export const raw = true;

test/correct-filename.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,34 +87,34 @@ describe('correct-filename', () => {
8787
describe('publicPath option', () => {
8888
it('should be supported', () => {
8989
expect(run('/file.txt', 'publicPath=http://cdn/').result).toEqual(
90-
'export default = "http://cdn/81dc9bdb52d04dc20036dbd8313ed055.txt";',
90+
'export default "http://cdn/81dc9bdb52d04dc20036dbd8313ed055.txt";',
9191
);
9292
});
9393
it('should override public path when given empty string', () => {
9494
expect(run('/file.txt', 'publicPath=').result).toEqual(
95-
'export default = "81dc9bdb52d04dc20036dbd8313ed055.txt";',
95+
'export default "81dc9bdb52d04dc20036dbd8313ed055.txt";',
9696
);
9797
});
9898
it('should use webpack public path when not set', () => {
9999
expect(run('/file.txt').result).toEqual(
100-
'export default = __webpack_public_path__ + "81dc9bdb52d04dc20036dbd8313ed055.txt";',
100+
'export default __webpack_public_path__ + "81dc9bdb52d04dc20036dbd8313ed055.txt";',
101101
);
102102
});
103103
});
104104

105105
describe('useRelativePath option', () => {
106106
it('should be supported', () => {
107107
expect(run('/this/is/the/context/file.txt', 'useRelativePath=true').result).toEqual(
108-
'export default = __webpack_public_path__ + \"./81dc9bdb52d04dc20036dbd8313ed055.txt\";',
108+
'export default __webpack_public_path__ + \"./81dc9bdb52d04dc20036dbd8313ed055.txt\";',
109109
);
110110
expect(run('/this/is/file.txt', 'useRelativePath=true').result).toEqual(
111-
'export default = __webpack_public_path__ + \"../../81dc9bdb52d04dc20036dbd8313ed055.txt\";',
111+
'export default __webpack_public_path__ + \"../../81dc9bdb52d04dc20036dbd8313ed055.txt\";',
112112
);
113113
expect(run('/this/file.txt', 'context=/this/is/the/&useRelativePath=true').result).toEqual(
114-
'export default = __webpack_public_path__ + \"../../81dc9bdb52d04dc20036dbd8313ed055.txt\";',
114+
'export default __webpack_public_path__ + \"../../81dc9bdb52d04dc20036dbd8313ed055.txt\";',
115115
);
116116
expect(run('/this/file.txt', 'context=/&useRelativePath=true').result).toEqual(
117-
'export default = __webpack_public_path__ + \"this/81dc9bdb52d04dc20036dbd8313ed055.txt\";',
117+
'export default __webpack_public_path__ + \"this/81dc9bdb52d04dc20036dbd8313ed055.txt\";',
118118
);
119119
});
120120
});
@@ -125,7 +125,7 @@ describe('outputPath function', () => {
125125
const options = {};
126126
options.outputPath = outputFunc;
127127
expect(runWithOptions('/this/is/the/context/file.txt', options).result).toEqual(
128-
'export default = __webpack_public_path__ + \"/path/set/by/func\";',
128+
'export default __webpack_public_path__ + \"/path/set/by/func\";',
129129
);
130130
});
131131
it('should be ignored if you set useRelativePath', () => {
@@ -134,7 +134,7 @@ describe('outputPath function', () => {
134134
options.outputPath = outputFunc;
135135
options.useRelativePath = true;
136136
expect(runWithOptions('/this/is/the/context/file.txt', options).result).toEqual(
137-
'export default = __webpack_public_path__ + \"./81dc9bdb52d04dc20036dbd8313ed055.txt\";',
137+
'export default __webpack_public_path__ + \"./81dc9bdb52d04dc20036dbd8313ed055.txt\";',
138138
);
139139
});
140140
});

0 commit comments

Comments
 (0)