Skip to content

Commit

Permalink
Merge pull request #76 from mottox2/extensions
Browse files Browse the repository at this point in the history
Support extensions: .mjs and .ts
  • Loading branch information
swyxio authored Nov 12, 2018
2 parents 7994dff + 32c3d00 commit 3ae931b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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) {
Expand Down

0 comments on commit 3ae931b

Please sign in to comment.