diff --git a/lib/build.js b/lib/build.js index 15f6246e..79e691a0 100644 --- a/lib/build.js +++ b/lib/build.js @@ -50,7 +50,7 @@ function webpackConfig(dir, additionalConfig) { module: { rules: [ { - test: /\.js?$/, + test: /\.(m?js|ts)?$/, exclude: /(node_modules|bower_components)/, use: { loader: "babel-loader", @@ -74,9 +74,9 @@ function webpackConfig(dir, additionalConfig) { devtool: false }; fs.readdirSync(dirPath).forEach(function(file) { - if (file.match(/\.js$/)) { - var name = file.replace(/\.js$/, ""); - webpackConfig.entry[name] = "./" + name; + if (file.match(/\.(m?js|ts)$/)) { + var name = file.replace(/\.(js|ts)$/, ""); + webpackConfig.entry[name] = "./" + file; } }); if (additionalConfig) {