Skip to content

Commit

Permalink
fix broken build
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jul 21, 2019
1 parent 1f8b476 commit 9152728
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

7 changes: 7 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: '@trendmicro/babel-config',
presets: [
'@babel/preset-env',
'@babel/preset-react'
]
};
30 changes: 20 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
const path = require('path');
const findImports = require('find-imports');
const webpack = require('webpack');
const pkg = require('./package.json');
const babelConfig = require('./babel.config');

module.exports = {
mode: 'production',
mode: 'development',
devtool: 'source-map',
entry: {
[pkg.name]: path.resolve(__dirname, 'src/index.js')
},
output: {
path: path.join(__dirname, 'lib'),
filename: 'index.js',
libraryTarget: 'commonjs2'
},
externals: []
.concat(findImports(['src/**/*.{js,jsx}'], { flatten: true }))
.concat(Object.keys(pkg.peerDependencies))
.concat(Object.keys(pkg.dependencies)),
module: {
rules: [
{
Expand All @@ -14,14 +30,8 @@ module.exports = {
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
exclude: /node_modules/,
options: babelConfig
},
]
},
Expand All @@ -31,7 +41,7 @@ module.exports = {
// This has effect on the react lib size
NODE_ENV: JSON.stringify('production')
}
})
}),
],
resolve: {
extensions: ['.js', '.json', '.jsx']
Expand Down

0 comments on commit 9152728

Please sign in to comment.