Skip to content

Instantly share code, notes, and snippets.

@NaridaL
Created October 14, 2017 21:57
Show Gist options
  • Save NaridaL/822b41cb441e49df340c495df9d4081a to your computer and use it in GitHub Desktop.
Save NaridaL/822b41cb441e49df340c495df9d4081a to your computer and use it in GitHub Desktop.
var path = require('path');
var webpack = require('webpack');
console.log(path.join(__dirname, 'node_modules/brepts/dist/bundle.js'))
module.exports = {
devtool: 'eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:2000',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/',
library: 'bundle'
},
resolve: {
extensions: ['.js', '.ts', '.tsx'],
alias: {
'react': 'preact-compat',
'react-dom': 'preact-compat',
// Not necessary unless you consume a module using `createClass`
'create-react-class': 'preact-compat/lib/create-react-class'
},
},
module: {
rules: [
// {
// test: /\.module\.js$/,
// use: ["source-map-loader"],
// enforce: "pre",
// // include: path.join(__dirname, 'node_modules/brepts/dist/bundle.module.js'),
// },
{
test: /\.tsx?$/,
use: [{
loader: 'awesome-typescript-loader',
options: { silent: true, transpileOnly: true }
}],
include: path.join(__dirname, 'src'),
},
]
},
devServer: {
// open: 'index.html',
headers: { "Access-Control-Allow-Origin": "*" },
// contentBase: '..',
},
externals: {
"opentype.js": "opentype",
"svg-pathdata": "svgpathdata",
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment