mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 18:39:58 +00:00
Use modified outputPath for static assets
This commit is contained in:
18
ext/build.js
18
ext/build.js
@@ -33,7 +33,15 @@ if (argv.package) {
|
|||||||
|
|
||||||
// Import webpack config and specify env values
|
// Import webpack config and specify env values
|
||||||
const webpackConfig = require("./webpack.config.js")({
|
const webpackConfig = require("./webpack.config.js")({
|
||||||
extensionName: "fx_cast"
|
/**
|
||||||
|
* If watching files, output directly to dist. Unpacked
|
||||||
|
* directory is used as a staging area for web-ext builds.
|
||||||
|
*/
|
||||||
|
outputPath: argv.package
|
||||||
|
? UNPACKED_PATH
|
||||||
|
: DIST_PATH
|
||||||
|
|
||||||
|
, extensionName: "fx_cast"
|
||||||
, extensionId: "fx_cast@matt.tf"
|
, extensionId: "fx_cast@matt.tf"
|
||||||
, extensionVersion: "0.0.1"
|
, extensionVersion: "0.0.1"
|
||||||
, mirroringAppId: argv.mirroringAppId
|
, mirroringAppId: argv.mirroringAppId
|
||||||
@@ -42,14 +50,6 @@ const webpackConfig = require("./webpack.config.js")({
|
|||||||
// Add mode to config
|
// Add mode to config
|
||||||
webpackConfig.mode = argv.mode;
|
webpackConfig.mode = argv.mode;
|
||||||
|
|
||||||
/**
|
|
||||||
* If watching files, output directly to dist. Unpacked
|
|
||||||
* directory is used as a staging area for web-ext builds.
|
|
||||||
*/
|
|
||||||
webpackConfig.output.path = argv.package
|
|
||||||
? UNPACKED_PATH
|
|
||||||
: DIST_PATH;
|
|
||||||
|
|
||||||
|
|
||||||
// Clean
|
// Clean
|
||||||
fs.removeSync(DIST_PATH);
|
fs.removeSync(DIST_PATH);
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|||||||
|
|
||||||
|
|
||||||
const includePath = path.resolve(__dirname, "src");
|
const includePath = path.resolve(__dirname, "src");
|
||||||
const outputPath = path.resolve(__dirname, "../dist/ext/unpacked");
|
|
||||||
|
|
||||||
module.exports = (env) => ({
|
module.exports = (env) => ({
|
||||||
entry: {
|
entry: {
|
||||||
@@ -22,7 +21,7 @@ module.exports = (env) => ({
|
|||||||
}
|
}
|
||||||
, output: {
|
, output: {
|
||||||
filename: "[name].js"
|
filename: "[name].js"
|
||||||
, path: `${outputPath}`
|
, path: `${env.outputPath}`
|
||||||
}
|
}
|
||||||
, plugins: [
|
, plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
@@ -35,7 +34,7 @@ module.exports = (env) => ({
|
|||||||
// Copy static assets
|
// Copy static assets
|
||||||
, new CopyWebpackPlugin([{
|
, new CopyWebpackPlugin([{
|
||||||
from: includePath
|
from: includePath
|
||||||
, to: outputPath
|
, to: env.outputPath
|
||||||
, ignore: [ "*.js", "*.jsx" ]
|
, ignore: [ "*.js", "*.jsx" ]
|
||||||
, transform (content, path) {
|
, transform (content, path) {
|
||||||
// Access to variables in static files
|
// Access to variables in static files
|
||||||
|
|||||||
Reference in New Issue
Block a user