chibat / chrome-extension-typescript-starter

Chrome Extension TypeScript Starter
MIT License
2.39k stars 403 forks source link

Webpack doesn't compile all ts files in src folder #26

Closed MaskyS closed 3 years ago

MaskyS commented 3 years ago

Hey @chibat, thank you for creating this template, really helps code extensions faster. Today I noticed as I coded up a few more ts files, that they weren't compiled to js. I got it to work by adding more entries in webpack.common.js:

module.exports = {
    entry: {
        popup: path.join(__dirname, srcDir + 'popup.ts'),
        options: path.join(__dirname, srcDir + 'options.ts'),
        background: path.join(__dirname, srcDir + 'background.ts'),
        home: path.join(__dirname, srcDir + 'home.ts'), // ! 
        utils: path.join(__dirname, srcDir + 'utils.ts') // !

But this seems rather inefficient. How can we direct it to compile all files in the folder without manually specifying each of them?

banjo commented 3 years ago

Yeah, I got that issue too. I added a pull request that fixed it!