Skip to content

Instantly share code, notes, and snippets.

@tobinbc
Last active July 22, 2019 12:48
Show Gist options
  • Save tobinbc/97e29c9546267edb1031cca8fb98af43 to your computer and use it in GitHub Desktop.
Save tobinbc/97e29c9546267edb1031cca8fb98af43 to your computer and use it in GitHub Desktop.
module.exports = {
context: 'src',
entry: {
popup: 'popup/popup.tsx',
"background-redirecter": 'background/redirecter/redirecter.ts',
"tab-redirect": 'tabs/redirect/redirect.tsx',
"content-redirect": 'content/redirect/redirect.ts',
"content-hangouts": 'content/hangouts/hangouts.ts',
},
output: {
filename: '[name].bundle.js',
path: 'dist'
},
module: {
rules: [
...
{
test: /\.scss$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].bundle.css'
}
},
{ loader: 'extract-loader' },
{ loader: 'css-loader' },
{
loader: 'sass-loader',
options: {
includePaths: ['./node_modules']
}
}
]
}
...
]
},
plugins: [
new CopyPlugin([{ from: 'assets/*', to: 'dist', flatten: true }]),
new HtmlWebpackPlugin({
chunks: ['popup'],
filename: 'popup.html',
template: 'popup/popup.html'
}),
new HtmlWebpackPlugin({
chunks: ['tab-redirect'],
filename: 'tab-redirect.html',
template: 'tabs/redirect/redirect.html'
})
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment