Skip to content

Commit

Permalink
feat(webpack): add initial configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
akoushke committed Feb 21, 2020
1 parent e07d92f commit 28bc898
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const path = require('path');
const webpack = require('webpack');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
cache: true,
node: {
fs: 'empty', // Webex SDK `fs` dependency does not exist in browser.
},
devtool: 'inline-source-map',
resolve: {
extensions: ['.js', '.jsx'],
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
},
],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /\.(woff(2)?|ttf|eot|svg|png)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
outputPath: 'assets/',
},
},
],
},
],
},
devServer: {
contentBase: path.resolve(__dirname, './demo'),
open: true,
overlay: true,
hot: true,
port: 9000,
stats: 'errors-warnings',
https: true,
},
plugins: [
new CleanWebpackPlugin({}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'demo/index.html',
}),
new webpack.HotModuleReplacementPlugin(),
],
};

0 comments on commit 28bc898

Please sign in to comment.