Skip to content

Commit d2d6bf4

Browse files
committed
Prevent export rewriting for main files.
1 parent 3496530 commit d2d6bf4

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

lib/engines/classic/main-file-info.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ var MainFileInfo = ClassicFileInfo.extend({
3030
if (!this.name) {
3131
this.name = path.basename(this.sourceRelativePath, this.ext);
3232
}
33-
}
33+
},
34+
35+
// do not rewrite exports for main files
36+
updateDefaultExportToNamed: function() { }
3437
});
3538

3639
Object.defineProperty(MainFileInfo.prototype, 'destRelativePath', {

test/fixtures/classic-helper-exports/input.js renamed to test/fixtures/classic-named-exports/input.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
22
app: {
3+
// ensure we do not rewrite main files
4+
'app.js': 'export default App',
5+
'router.js': 'export default Router',
36
helpers: {
47
'titleize.js': 'export default helper(function() { });',
58
'capitalize.js': 'export default helper(function() { });'

test/fixtures/classic-helper-exports/output.js renamed to test/fixtures/classic-named-exports/output.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = {
22
src: {
3+
'main.js': 'export default App',
4+
'router.js': 'export default Router',
35
ui: {
46
components: {
57
'titleize.js': 'export const helper = helper(function() { });',

0 commit comments

Comments
 (0)