mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 17:49:58 +00:00
Initial commit
This commit is contained in:
57
ext/webpack.config.js
Executable file
57
ext/webpack.config.js
Executable file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const webpack_copy = require("copy-webpack-plugin");
|
||||
|
||||
|
||||
const include_path = path.resolve(__dirname, "src");
|
||||
const output_path = path.resolve(__dirname, "dist");
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
"main" : `${include_path}/main.js`
|
||||
, "popup/bundle" : `${include_path}/popup/index.js`
|
||||
, "shim/bundle" : `${include_path}/shim/index.js`
|
||||
, "content" : `${include_path}/content.js`
|
||||
, "contentSetup" : `${include_path}/contentSetup.js`
|
||||
, "mediaCast" : `${include_path}/mediaCast.js`
|
||||
, "compat/youtube" : `${include_path}/compat/youtube.js`
|
||||
}
|
||||
, output: {
|
||||
filename: "[name].js"
|
||||
, path: `${output_path}`
|
||||
}
|
||||
, plugins: [
|
||||
new webpack.optimize.UglifyJsPlugin()
|
||||
//, new webpack.optimize.CommonsChunkPlugin("lib/init.bundle")
|
||||
, new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": `"production"`
|
||||
})
|
||||
|
||||
// Ext copy assets
|
||||
, new webpack_copy([{
|
||||
from: `${include_path}`
|
||||
, to: `${output_path}`
|
||||
, ignore: [ "*.js" ]
|
||||
}])
|
||||
]
|
||||
, devtool: "source-map"
|
||||
, module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.js/
|
||||
, include: `${include_path}`
|
||||
, loader: "babel-loader"
|
||||
, options: {
|
||||
presets: [ "react" ]
|
||||
, plugins: [
|
||||
"transform-class-properties"
|
||||
, "transform-do-expressions"
|
||||
, "transform-object-rest-spread"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user