opds-web-client
Version:
49 lines (46 loc) • 1.16 kB
JavaScript
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var config = {
entry: {
app: [
'./src/app.tsx',
],
},
output: {
path: './dist',
filename: 'opds-web-client.js',
library: 'OPDSWebClient',
libraryTarget: 'umd'
},
plugins: [
new webpack.DefinePlugin({ "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV) }),
// jsdom is needed for server rendering, but causes errors
// in the browser even if it is never used, so we ignore it:
new webpack.IgnorePlugin(/jsdom$/),
// Extract separate css file.
new ExtractTextPlugin("opds-web-client.css")
],
module: {
loaders: [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!sass-loader")
},
{
test: /\.tsx?$/,
exclude: [/node_modules/],
loaders: [
'ts-loader'
]
},
{
test: /\.json$/,
loaders: ['json-loader']
}
],
},
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".js", ".ts", ".tsx", ".scss"]
}
};
module.exports = config;