Created
October 14, 2017 21:57
-
-
Save NaridaL/822b41cb441e49df340c495df9d4081a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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