Skip to content

Commit

Permalink
add htm extension (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper De Moor authored and devongovett committed Jan 25, 2018
1 parent e9596d6 commit 3d67091
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Parser {
this.registerExtension('scss', './assets/SASSAsset');

this.registerExtension('html', './assets/HTMLAsset');
this.registerExtension('htm', './assets/HTMLAsset');
this.registerExtension('rs', './assets/RustAsset');

let extensions = options.extensions || {};
Expand Down
21 changes: 21 additions & 0 deletions test/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,25 @@ describe('html', function() {
]
});
});

it('should support bundling HTM', async function() {
let b = await bundle(__dirname + '/integration/htm-extension/index.htm');

assertBundleTree(b, {
name: 'index.html',
assets: ['index.htm'],
type: 'html',
childBundles: [
{
type: 'js',
assets: ['index.js'],
childBundles: [
{
type: 'map'
}
]
}
]
});
});
});
10 changes: 10 additions & 0 deletions test/integration/htm-extension/index.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>HTM File</title>
</head>
<body>
<h1>Hello world</h1>
<script src="index.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions test/integration/htm-extension/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert('Hi');

0 comments on commit 3d67091

Please sign in to comment.