Last active
March 15, 2020 10:43
-
-
Save mizchi/8541ddaf598a79d13096f9f0f869c335 to your computer and use it in GitHub Desktop.
This file contains 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
const rewire = require("rewire"); | |
const path = require("path"); | |
const defaults = rewire("react-scripts/scripts/build.js"); | |
const config = defaults.__get__("config"); | |
config.optimization.runtimeChunk = false; | |
config.output.filename = "excalidraw.js"; | |
config.output.libraryTarget = "umd"; | |
config.output.library = "Excalidraw"; | |
config.output.path = path.join(__dirname, "../dist"); | |
config.entry = "./src/export"; | |
config.externals = ["react", "react-dom"]; | |
config.resolve.extensions = [".js", ".ts", ".tsx", ".scss", ".mjs"]; | |
config.module.rules.push( | |
{ | |
test: /\.css/, | |
use: [ | |
"style-loader", | |
{ | |
loader: "css-loader", | |
options: { url: false }, | |
}, | |
], | |
}, | |
{ | |
test: /\.scss/, | |
use: [ | |
"style-loader", | |
{ | |
loader: "sass-loader", | |
options: { url: false }, | |
}, | |
], | |
}, | |
); | |
config.plugins = []; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment