Skip to content

Commit 3ae931b

Browse files
authored
Merge pull request #76 from mottox2/extensions
Support extensions: .mjs and .ts
2 parents 7994dff + 32c3d00 commit 3ae931b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/build.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function webpackConfig(dir, additionalConfig) {
5050
module: {
5151
rules: [
5252
{
53-
test: /\.js?$/,
53+
test: /\.(m?js|ts)?$/,
5454
exclude: /(node_modules|bower_components)/,
5555
use: {
5656
loader: "babel-loader",
@@ -74,9 +74,9 @@ function webpackConfig(dir, additionalConfig) {
7474
devtool: false
7575
};
7676
fs.readdirSync(dirPath).forEach(function(file) {
77-
if (file.match(/\.js$/)) {
78-
var name = file.replace(/\.js$/, "");
79-
webpackConfig.entry[name] = "./" + name;
77+
if (file.match(/\.(m?js|ts)$/)) {
78+
var name = file.replace(/\.(js|ts)$/, "");
79+
webpackConfig.entry[name] = "./" + file;
8080
}
8181
});
8282
if (additionalConfig) {

0 commit comments

Comments
 (0)