1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/app-clipper/popup/webpack.config.js

43 lines
849 B
JavaScript
Raw Normal View History

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = (env, argv) => ({
entry: './src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'build'),
},
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html',
}),
],
// Avoid the default 'eval-source-map' -- Chrome seems to prevent usage of eval
// in popups.
devtool: argv.mode === 'development' ? 'cheap-source-map' : undefined,
module: {
rules: [
{
test: /\.(?:js|mjs|cjs)$/i,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-react'],
],
},
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /.png$/i,
type: 'asset/inline',
},
],
},
});