bruno/packages/grafnode-components/webpack.config.js

49 lines
1.2 KiB
JavaScript
Raw Normal View History

const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: "./src/index.js",
output: {
publicPath: '',
globalObject: 'this',
filename: "index.js",
path: path.resolve(__dirname, "dist"),
libraryTarget: "umd",
library: "@grafnode/components"
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.css$/,
use: [ MiniCssExtractPlugin.loader, 'css-loader' ]
}
]
},
externals: {
2021-12-03 19:46:54 +01:00
'react': 'react',
'lodash': 'lodash',
2021-12-03 19:46:54 +01:00
'styled-components': 'styled-components',
'@tippyjs/react': '@tippyjs/react',
'@tabler/icons': '@tabler/icons',
2021-12-03 19:46:54 +01:00
'@fortawesome/free-solid-svg-icons': '@fortawesome/free-solid-svg-icons',
2021-12-03 21:33:46 +01:00
'@fortawesome/react-fontawesome': '@fortawesome/react-fontawesome',
'classnames': 'classnames',
'react-tabs': 'react-tabs',
'codemirror': 'codemirror',
'graphql': 'graphql',
'escape-html': 'escape-html',
'markdown-it': 'markdown-it',
2021-12-31 17:58:40 +01:00
'nanoid': 'nanoid',
'graphql-request': 'graphql-request'
},
plugins: [
new MiniCssExtractPlugin()
]
};