37 lines
No EOL
705 B
JavaScript
37 lines
No EOL
705 B
JavaScript
const path = require("path");
|
|
const webpack = require("webpack");
|
|
|
|
module.exports = (env, options) => ({
|
|
|
|
entry: './src/index.jsx',
|
|
output: {
|
|
path: path.resolve(__dirname, 'public'),
|
|
filename: 'bundle.js',
|
|
publicPath: "/",
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.jsx$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader"
|
|
}
|
|
},
|
|
{
|
|
test: /\.s?css$/,
|
|
use: ["style-loader", "css-loader", "sass-loader"]
|
|
},
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.jsx'],
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env': {
|
|
'apiBaseUrl': options.mode === 'development' ? '"http://localhost:8025"' : '""',
|
|
}
|
|
}),
|
|
]
|
|
}); |