Skip to content

Instantly share code, notes, and snippets.

@tmcw
Last active December 13, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/bd63b878169fd676e32c34096e58060f to your computer and use it in GitHub Desktop.
Save tmcw/bd63b878169fd676e32c34096e58060f to your computer and use it in GitHub Desktop.
import * as Library from "@observablehq/stdlib";
{
"dependencies": {
"@observablehq/stdlib": "^2.0.3",
"extract-text-webpack-plugin": "^3.0.2",
"html-webpack-plugin": "^3.2.0",
"webpack": "3.6.0",
"source-map-loader": "^0.2.4"
},
"scripts": {
"test": "webpack --config=webpack.js"
}
}
"use strict";
const path = require("path");
const webpack = require("webpack");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: "./index.js",
output: {
filename: "bundle.js",
path: path.join(__dirname, "dist")
},
module: {
rules: [
{
enforce: "pre",
test: /\.js$/,
use: ["source-map-loader"]
},
{
enforce: "pre",
test: /\.ts$/,
use: ["source-map-loader"]
},
{
test: /\.ts$/,
loader: "ts-loader"
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: "css-loader",
fallback: "style-loader"
})
},
{
test: /\.(png|woff|woff2|eot|ttf|svg|jpg)$/,
loader: "url-loader?limit=100000"
}
]
},
devtool: "source-map",
plugins: [
new ExtractTextPlugin("styles.css"),
new HtmlWebpackPlugin({
title: "Project"
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new webpack.NormalModuleReplacementPlugin(/AsyncLoad\.js/, function(
resource
) {
resource.request = resource.request.replace(
/AsyncLoad/,
"AsyncLoad-disabled"
);
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment