Skip to content

Commit

Permalink
Add config for Babel and Webpack.
Browse files Browse the repository at this point in the history
  • Loading branch information
Potherca committed Jul 23, 2021
1 parent c2da894 commit 5493d3e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/syntax-dynamic-import"
],
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
]
}
45 changes: 45 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');

const stylesHandler = 'style-loader';

module.exports = [{
devtool: 'source-map',
entry: './src/index.js',
mode: 'development',
module: {
rules: [
{
test: /\.css$/i,
use: [stylesHandler,'css-loader'],
},
{
test: /\.(js)$/,
exclude: /(node_modules)/,
loader: 'babel-loader'
},
{
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
type: 'asset',
},

// Add your rules for custom modules here
// Learn more about loaders from https://webpack.js.org/loaders/
],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'main.js'
},
plugins: [
// new HtmlWebpackPlugin({
// template: 'index.html',
// }),

// Add your plugins here
// Learn more about plugins from https://webpack.js.org/configuration/plugins/
],
resolve: {
fallback: {"buffer": false}
}
}];

0 comments on commit 5493d3e

Please sign in to comment.