From 618754b41153973b7967d617d4894643bce1b9fd Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 23 Aug 2018 18:10:46 +0100 Subject: [PATCH] Moved FB plugin to plugins folder --- plugins/fbinstant/readme.md | 4 ++ .../fbinstant/src}/AdInstance.js | 0 .../src}/FacebookInstantGamesPlugin.js | 4 +- .../fbinstant/src}/Leaderboard.js | 0 .../fbinstant/src}/LeaderboardScore.js | 0 .../fbinstant/src}/Product.js | 0 .../fbinstant/src}/Purchase.js | 0 plugins/fbinstant/webpack.config.js | 47 +++++++++++++++++++ 8 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 plugins/fbinstant/readme.md rename {src/fbinstant => plugins/fbinstant/src}/AdInstance.js (100%) rename {src/fbinstant => plugins/fbinstant/src}/FacebookInstantGamesPlugin.js (99%) rename {src/fbinstant => plugins/fbinstant/src}/Leaderboard.js (100%) rename {src/fbinstant => plugins/fbinstant/src}/LeaderboardScore.js (100%) rename {src/fbinstant => plugins/fbinstant/src}/Product.js (100%) rename {src/fbinstant => plugins/fbinstant/src}/Purchase.js (100%) create mode 100644 plugins/fbinstant/webpack.config.js diff --git a/plugins/fbinstant/readme.md b/plugins/fbinstant/readme.md new file mode 100644 index 000000000..7e1e62376 --- /dev/null +++ b/plugins/fbinstant/readme.md @@ -0,0 +1,4 @@ +Phaser 3 Facebook Instant Games Plugin +====================================== + +This is a work-in-progress FB Instant Games plugin and will be released fully with Phaser 3.13. diff --git a/src/fbinstant/AdInstance.js b/plugins/fbinstant/src/AdInstance.js similarity index 100% rename from src/fbinstant/AdInstance.js rename to plugins/fbinstant/src/AdInstance.js diff --git a/src/fbinstant/FacebookInstantGamesPlugin.js b/plugins/fbinstant/src/FacebookInstantGamesPlugin.js similarity index 99% rename from src/fbinstant/FacebookInstantGamesPlugin.js rename to plugins/fbinstant/src/FacebookInstantGamesPlugin.js index 5573721f2..6ee7995df 100644 --- a/src/fbinstant/FacebookInstantGamesPlugin.js +++ b/plugins/fbinstant/src/FacebookInstantGamesPlugin.js @@ -7,8 +7,8 @@ */ var AdInstance = require('./AdInstance'); -var Class = require('../utils/Class'); -var DataManager = require('../data/DataManager'); +var Class = require('../../../src/utils/Class'); +var DataManager = require('../../../src/data/DataManager'); var EventEmitter = require('eventemitter3'); var Leaderboard = require('./Leaderboard'); var Product = require('./Product'); diff --git a/src/fbinstant/Leaderboard.js b/plugins/fbinstant/src/Leaderboard.js similarity index 100% rename from src/fbinstant/Leaderboard.js rename to plugins/fbinstant/src/Leaderboard.js diff --git a/src/fbinstant/LeaderboardScore.js b/plugins/fbinstant/src/LeaderboardScore.js similarity index 100% rename from src/fbinstant/LeaderboardScore.js rename to plugins/fbinstant/src/LeaderboardScore.js diff --git a/src/fbinstant/Product.js b/plugins/fbinstant/src/Product.js similarity index 100% rename from src/fbinstant/Product.js rename to plugins/fbinstant/src/Product.js diff --git a/src/fbinstant/Purchase.js b/plugins/fbinstant/src/Purchase.js similarity index 100% rename from src/fbinstant/Purchase.js rename to plugins/fbinstant/src/Purchase.js diff --git a/plugins/fbinstant/webpack.config.js b/plugins/fbinstant/webpack.config.js new file mode 100644 index 000000000..06005d860 --- /dev/null +++ b/plugins/fbinstant/webpack.config.js @@ -0,0 +1,47 @@ +'use strict'; + +const webpack = require('webpack'); +const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); + +module.exports = { + mode: 'production', + + context: `${__dirname}/src/`, + + entry: { + camera3d: './FacebookInstantGamesPlugin.js', + 'camera3d.min': './FacebookInstantGamesPlugin.js' + }, + + output: { + path: `${__dirname}/dist/`, + filename: '[name].js', + library: 'FacebookInstantGamesPlugin', + libraryTarget: 'var' + }, + + performance: { hints: false }, + + optimization: { + minimizer: [ + new UglifyJSPlugin({ + include: /\.min\.js$/, + parallel: true, + sourceMap: false, + uglifyOptions: { + compress: true, + ie8: false, + ecma: 5, + output: {comments: false}, + warnings: false + }, + warningsFilter: () => false + }) + ] + }, + + plugins: [ + new CleanWebpackPlugin([ 'dist' ]) + ] +};