etalon_backend/themes/tps react/webpack.config.js

49 lines
948 B
JavaScript

const path = require('path');
module.exports = {
entry: path.resolve(__dirname, './src/index.js'),
output: {
path: path.resolve(__dirname, './public'),
filename: 'bundle.js',
publicPath: '/'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.(jpg|png|svg)$/,
use: {
loader: 'url-loader',
},
},
],
},
resolve: {
extensions: ['*', '.js', '.jsx'],
},
devServer: {
contentBase: path.resolve(__dirname, './public'),
// publicPath: "/src/pages/",
// historyApiFallback: true,
historyApiFallback: true,
inline:true,
host: '127.0.0.1',
port: 8000
// contentBase: './',
// hot: true
},
};