Created
January 1, 2021 13:22
-
-
Save mrtcmn/6fea1fc0823ffbfe7e6f9c066ebc3ca9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const outputPath = path.join(__dirname, "dist") | |
const port = process.env.PORT || 3000; | |
module.exports = { | |
context: __dirname, | |
entry: './src/App.jsx', | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: 'bundle.js', | |
}, | |
resolve: { | |
modules: ['node_modules', './src'], | |
extensions: ['.js', '.jsx'], | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.scss$/, | |
use: ExtractTextPlugin.extract({ | |
use: 'css-loader!sass-loader' | |
}), | |
}, | |
{ | |
test: /\.css$/, | |
use: ExtractTextPlugin.extract({ | |
use: 'css-loader' | |
}), | |
}, | |
{ | |
test: /\.less$/, | |
loaders: [ | |
'style-loader', | |
{ loader: 'css-loader', options: { importLoaders: 1 } }, | |
'less-loader', | |
], | |
}, | |
{ | |
test: /\.(js|jsx)$/, | |
loader: 'babel-loader', | |
exclude: /node_modules/ | |
} | |
] | |
}, | |
plugins: [ | |
new ExtractTextPlugin("bundle.css"), | |
], | |
devServer: { | |
port, | |
historyApiFallback: true, | |
publicPath: '/dist/', | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment