-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin): Add support for Stanford Diagrams
- Implement plugin interface - Implement Stanford Diagram plugin Fix #829
- Loading branch information
1 parent
aba40cf
commit a162cb7
Showing
37 changed files
with
1,947 additions
and
652 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ Jinwoo Oh <[email protected]> | |
Nirmal Guna <[email protected]> | ||
Michael Yungerman <[email protected]> | ||
Malte Batram <[email protected]> | ||
Daniel Oliveira <[email protected]> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
const merge = require("webpack-merge"); | ||
const webpack = require("webpack"); | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const CleanWebpackPlugin = require("clean-webpack-plugin"); | ||
const UglifyJSPlugin = require("uglifyjs-webpack-plugin"); | ||
const uglifyConfig = require("./uglify"); | ||
const banner = require("./banner"); | ||
|
||
const srcPath = "./src/plugin/"; | ||
const distPath = path.resolve(__dirname, "../dist/plugin/"); | ||
|
||
// construct entry point | ||
const entry = {}; | ||
|
||
fs.readdirSync(path.resolve(__dirname, `.${srcPath}`), { | ||
withFileTypes: true | ||
}).forEach(dirent => { | ||
if (dirent.isDirectory()) { | ||
const name = dirent.name; | ||
|
||
entry[name] = `${srcPath}${name}/index.js`; | ||
} | ||
}); | ||
|
||
const config = { | ||
entry: entry, | ||
output: { | ||
path: distPath, | ||
filename: `billboardjs-plugin-[name].js`, | ||
library: ["bb", "plugin", "[name]"], | ||
libraryExport: "default", | ||
libraryTarget: "umd", | ||
umdNamedDefine: true | ||
}, | ||
devtool: false, | ||
plugins: [ | ||
new webpack.BannerPlugin({ | ||
banner: banner.production, | ||
entryOnly: true | ||
}) | ||
] | ||
}; | ||
|
||
module.exports = (common, env) => { | ||
if (env && env.MIN) { | ||
config.output.filename = config.output.filename.replace(".js", ".min.js"); | ||
config.plugins.push(new UglifyJSPlugin(uglifyConfig)); | ||
} else { | ||
config.plugins.push(new CleanWebpackPlugin({ | ||
cleanOnceBeforeBuildPatterns: [distPath], | ||
verbose: true, | ||
dry: false, | ||
beforeEmit: true | ||
})); | ||
} | ||
|
||
return merge.smartStrategy({ | ||
entry: "replace", | ||
output: "replace", | ||
module: "replace" | ||
})(common, config); | ||
}; |
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
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
Oops, something went wrong.