You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
react-whitelabel/webpack.common.js

52 lines
1.6 KiB
JavaScript

5 years ago
// Copyright 2020 Thomas Hintz
//
// This file is part of the react-whitelabel project.
//
// The react-whitelabel project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General
// Public License as published by the Free Software Foundation, either
// version 3 of the License, or (at your option) any later version OR
// under the terms of the MIT license.
//
// The react-whitelabel project is distributed in the hope that
// it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE.
//
// You should have received a copy of the GNU General Public License
// and MIT License along with the react-whitelabel project. If not,
// see <https://www.gnu.org/licenses/> and
// <https://opensource.org/licenses/MIT>.
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
entry: {
app: './index.js',
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs2'
},
plugins: [
new CleanWebpackPlugin(),
],
module: {
rules: [
{
test: /\.m?(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { modules: false }],
"@babel/preset-react",],
}
}
},
],
},
};