delta-component
Version:
embeddable react component
55 lines (53 loc) • 1.45 kB
JavaScript
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, "src/components/aceeditor/aceeditor.react.js"),
output: {
filename: 'component.js',
path: path.resolve(__dirname, 'dist'),
library: 'aceeditor',
libraryTarget: 'umd',
publicPath: '/dist/',
umdNamedDefine: true
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
use: [
{
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
require.resolve('babel-preset-es2015'),
require.resolve('babel-preset-react-app'),
],
cacheDirectory: true,
}
}
]
},
{
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" }
]
}
]
},
resolve: {
extensions: [".js"],
alias: {
'react': path.resolve(__dirname, './node_modules/react'),
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
}
},
externals: {
react: 'react',
"react-dom": 'react-dom'
},
node: {
fs: "empty"
}
};