Updated Spine webpack configs and runtimes

This commit is contained in:
Richard Davey 2019-08-08 13:31:52 +01:00
parent dce27a8dcf
commit 57a2bb171e
9 changed files with 76 additions and 4717 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
'use strict';
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
module.exports = {
mode: 'development',
@ -10,7 +10,7 @@ module.exports = {
context: `${__dirname}/src/`,
entry: {
'SpinePlugin': './SpinePlugin.js'
'SpinePluginDebug': './SpinePlugin.js'
},
output: {
@ -50,7 +50,12 @@ module.exports = {
"typeof CANVAS_RENDERER": JSON.stringify(true),
"typeof WEBGL_RENDERER": JSON.stringify(true)
}),
new CleanWebpackPlugin([ 'dist' ]),
new RemovePlugin({
before: {
root: './plugins/spine/dist/',
include: [ 'SpinePluginDebug.js', 'SpinePluginDebug.js.map' ]
}
}),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {

View file

@ -2,8 +2,8 @@
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
module.exports = {
mode: 'production',
@ -11,19 +11,15 @@ module.exports = {
context: `${__dirname}/src/`,
entry: {
'SpinePlugin': './SpineWebGLPlugin.js',
'SpinePlugin.min': './SpineWebGLPlugin.js'
'SpinePlugin': './SpinePlugin.js',
'SpinePlugin.min': './SpinePlugin.js'
},
output: {
path: `${__dirname}/dist/`,
filename: '[name].js',
library: 'SpinePlugin',
libraryTarget: 'umd',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
umdNamedDefine: true
libraryTarget: 'window'
},
performance: { hints: false },
@ -31,19 +27,11 @@ module.exports = {
module: {
rules: [
{
test: require.resolve('./src/runtimes/spine-canvas.js'),
test: require.resolve('./src/runtimes/spine-both.js'),
use: 'imports-loader?this=>window'
},
{
test: require.resolve('./src/runtimes/spine-canvas.js'),
use: 'exports-loader?spine'
},
{
test: require.resolve('./src/runtimes/spine-webgl.js'),
use: 'imports-loader?this=>window'
},
{
test: require.resolve('./src/runtimes/spine-webgl.js'),
test: require.resolve('./src/runtimes/spine-both.js'),
use: 'exports-loader?spine'
}
]
@ -51,8 +39,7 @@ module.exports = {
resolve: {
alias: {
'SpineCanvas': './runtimes/spine-canvas.js',
'SpineWebGL': './runtimes/spine-webgl.js'
'Spine': './runtimes/spine-both.js'
},
},
@ -79,7 +66,12 @@ module.exports = {
"typeof CANVAS_RENDERER": JSON.stringify(true),
"typeof WEBGL_RENDERER": JSON.stringify(true)
}),
new CleanWebpackPlugin([ 'dist' ]),
new RemovePlugin({
before: {
root: './plugins/spine/dist/',
include: [ 'SpinePlugin.js', 'SpinePlugin.min.js' ]
}
}),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {

View file

@ -1,8 +1,8 @@
'use strict';
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
module.exports = {
mode: 'development',
@ -10,14 +10,14 @@ module.exports = {
context: `${__dirname}/src/`,
entry: {
'SpineCanvasPlugin': './SpineCanvasPlugin.js'
'SpineCanvasPluginDebug': './SpinePlugin.js'
},
output: {
path: `${__dirname}/dist/`,
filename: '[name].js',
library: 'SpineCanvasPlugin',
libraryTarget: 'umd',
library: 'SpinePlugin',
libraryTarget: 'window',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
@ -35,23 +35,14 @@ module.exports = {
{
test: require.resolve('./src/runtimes/spine-canvas.js'),
use: 'exports-loader?spine'
},
{
test: require.resolve('./src/runtimes/spine-webgl.js'),
use: 'imports-loader?this=>window'
},
{
test: require.resolve('./src/runtimes/spine-webgl.js'),
use: 'exports-loader?spine'
}
]
},
resolve: {
alias: {
'SpineCanvas': './runtimes/spine-canvas.js',
'SpineWebGL': './runtimes/spine-webgl.js'
},
'Spine': './runtimes/spine-canvas.js'
}
},
plugins: [
@ -59,7 +50,14 @@ module.exports = {
"typeof CANVAS_RENDERER": JSON.stringify(true),
"typeof WEBGL_RENDERER": JSON.stringify(false)
}),
new CleanWebpackPlugin([ 'dist' ]),
new RemovePlugin({
before: {
before: {
root: './plugins/spine/dist/',
include: [ 'SpineCanvasPluginDebug.js', 'SpineCanvasPluginDebug.js.map' ]
}
}
}),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {

View file

@ -2,8 +2,8 @@
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
module.exports = {
mode: 'production',
@ -11,19 +11,15 @@ module.exports = {
context: `${__dirname}/src/`,
entry: {
'SpineCanvasPlugin': './SpineCanvasPlugin.js',
'SpineCanvasPlugin.min': './SpineCanvasPlugin.js'
'SpineCanvasPlugin': './SpinePlugin.js',
'SpineCanvasPlugin.min': './SpinePlugin.js'
},
output: {
path: `${__dirname}/dist/`,
filename: '[name].js',
library: 'SpineCanvasPlugin',
libraryTarget: 'umd',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
umdNamedDefine: true
library: 'SpinePlugin',
libraryTarget: 'window'
},
performance: { hints: false },
@ -37,23 +33,14 @@ module.exports = {
{
test: require.resolve('./src/runtimes/spine-canvas.js'),
use: 'exports-loader?spine'
},
{
test: require.resolve('./src/runtimes/spine-webgl.js'),
use: 'imports-loader?this=>window'
},
{
test: require.resolve('./src/runtimes/spine-webgl.js'),
use: 'exports-loader?spine'
}
]
},
resolve: {
alias: {
'SpineCanvas': './runtimes/spine-canvas.js',
'SpineWebGL': './runtimes/spine-webgl.js'
},
'Spine': './runtimes/spine-canvas.js'
}
},
optimization: {
@ -79,7 +66,14 @@ module.exports = {
"typeof CANVAS_RENDERER": JSON.stringify(true),
"typeof WEBGL_RENDERER": JSON.stringify(false)
}),
new CleanWebpackPlugin([ 'dist' ]),
new RemovePlugin({
before: {
before: {
root: './plugins/spine/dist/',
include: [ 'SpineCanvasPlugin.js', 'SpineCanvasPlugin.min.js' ]
}
}
}),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {

View file

@ -1,8 +1,8 @@
'use strict';
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
module.exports = {
mode: 'development',
@ -10,14 +10,14 @@ module.exports = {
context: `${__dirname}/src/`,
entry: {
'SpinePlugin': './SpinePlugin.js'
'SpineWebGLPluginDebug': './SpinePlugin.js'
},
output: {
path: `${__dirname}/dist/`,
filename: '[name].js',
library: 'SpinePlugin',
libraryTarget: 'umd',
libraryTarget: 'window',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
@ -50,7 +50,14 @@ module.exports = {
"typeof CANVAS_RENDERER": JSON.stringify(false),
"typeof WEBGL_RENDERER": JSON.stringify(true)
}),
new CleanWebpackPlugin([ 'dist' ]),
new RemovePlugin({
before: {
before: {
root: './plugins/spine/dist/',
include: [ 'SpineWebGLPluginDebug.js', 'SpineWebGLPluginDebug.js.map' ]
}
}
}),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {

View file

@ -2,8 +2,8 @@
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const exec = require('child_process').exec;
const RemovePlugin = require('remove-files-webpack-plugin');
module.exports = {
mode: 'production',
@ -11,33 +11,21 @@ module.exports = {
context: `${__dirname}/src/`,
entry: {
'SpineWebGLPlugin': './SpineWebGLPlugin.js',
'SpineWebGLPlugin.min': './SpineWebGLPlugin.js'
'SpineWebGLPlugin': './SpinePlugin.js',
'SpineWebGLPlugin.min': './SpinePlugin.js'
},
output: {
path: `${__dirname}/dist/`,
filename: '[name].js',
library: 'SpineWebGLPlugin',
libraryTarget: 'umd',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]', // string
devtoolFallbackModuleFilenameTemplate: 'webpack:///[resource-path]?[hash]', // string
umdNamedDefine: true
library: 'SpinePlugin',
libraryTarget: 'window'
},
performance: { hints: false },
module: {
rules: [
{
test: require.resolve('./src/runtimes/spine-canvas.js'),
use: 'imports-loader?this=>window'
},
{
test: require.resolve('./src/runtimes/spine-canvas.js'),
use: 'exports-loader?spine'
},
{
test: require.resolve('./src/runtimes/spine-webgl.js'),
use: 'imports-loader?this=>window'
@ -51,9 +39,8 @@ module.exports = {
resolve: {
alias: {
'SpineCanvas': './runtimes/spine-canvas.js',
'SpineWebGL': './runtimes/spine-webgl.js'
},
'Spine': './runtimes/spine-webgl.js'
}
},
optimization: {
@ -79,7 +66,14 @@ module.exports = {
"typeof CANVAS_RENDERER": JSON.stringify(false),
"typeof WEBGL_RENDERER": JSON.stringify(true)
}),
new CleanWebpackPlugin([ 'dist' ]),
new RemovePlugin({
before: {
before: {
root: './plugins/spine/dist/',
include: [ 'SpineWebGLPlugin.js', 'SpineWebGLPlugin.min.js' ]
}
}
}),
{
apply: (compiler) => {
compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {