Skip to content

Commit

Permalink
Adding dependency three.js
Browse files Browse the repository at this point in the history
- Added to npm package list
- Changed webpack config to include three in vendor
  • Loading branch information
Olliebrown committed Oct 15, 2019
1 parent 378bf5a commit 671aa5f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"phaser": "^3.17.0",
"phaser-plugin-debug-draw": "^2.0.1",
"phaser-plugin-game-scale": "^1.3.3",
"phaser-plugin-update": "^2.0.2"
"phaser-plugin-update": "^2.0.2",
"three": "^0.109.0"
},
"window": {
"title": "GDD 325 Example Game",
Expand Down
10 changes: 5 additions & 5 deletions webpack.deploy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const MinifyPlugin = require('babel-minify-webpack-plugin')

// Phaser webpack config
var phaserModule = path.join(__dirname, '/node_modules/phaser/')
var phaser = path.join(phaserModule, 'src/phaser.js')
var Phaser = path.join(phaserModule, 'src/phaser.js')

// These variables will be injected into the global namespace
// - if __DEV__ is true then the program is running in a development environment
Expand All @@ -20,7 +20,7 @@ const definePlugin = new webpack.DefinePlugin({
module.exports = {
entry: {
app: path.resolve(__dirname, 'src/main.js'),
vendor: ['phaser', 'phaser-plugin-update', '@babel/polyfill']
vendor: ['phaser', 'phaser-plugin-update', 'three', '@babel/polyfill']
},
output: {
path: path.resolve(__dirname, 'dist'),
Expand Down Expand Up @@ -62,7 +62,8 @@ module.exports = {
hash: false
}),
new MinifyPlugin({}, { comments: false }),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.ProvidePlugin({ THREE: 'three' })
],
module: {
rules: [
Expand All @@ -74,8 +75,7 @@ module.exports = {
},
resolve: {
alias: {
'phaser': phaser
phaser: Phaser
}
}
}

7 changes: 4 additions & 3 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')

// Phaser webpack config
var phaserModule = path.join(__dirname, '/node_modules/phaser/')
var phaser = path.join(phaserModule, 'src/phaser.js')
var Phaser = path.join(phaserModule, 'src/phaser.js')

// These variables will be injected into the global namespace
// - if __DEV__ is true then the program is running in a development environment
Expand All @@ -20,7 +20,7 @@ const definePlugin = new webpack.DefinePlugin({
module.exports = {
entry: {
app: path.resolve(__dirname, 'src/main.js'),
vendor: ['phaser', 'phaser-plugin-update', 'phaser-plugin-debug-draw', '@babel/polyfill']
vendor: ['phaser', 'phaser-plugin-update', 'phaser-plugin-debug-draw', 'three', '@babel/polyfill']
},
devtool: 'cheap-source-map',
output: {
Expand Down Expand Up @@ -65,6 +65,7 @@ module.exports = {
hash: false
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.ProvidePlugin({ THREE: 'three' }),
new BrowserSyncPlugin({
host: process.env.IP || 'localhost',
port: process.env.PORT || 3000,
Expand All @@ -84,7 +85,7 @@ module.exports = {
},
resolve: {
alias: {
'phaser': phaser
phaser: Phaser
}
}
}
7 changes: 4 additions & 3 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')

// Phaser webpack config
var phaserModule = path.join(__dirname, '/node_modules/phaser/')
var phaser = path.join(phaserModule, 'src/phaser.js')
var Phaser = path.join(phaserModule, 'src/phaser.js')

// These variables will be injected into the global namespace
// - if __DEV__ is true then the program is running in a development environment
Expand All @@ -21,7 +21,7 @@ const definePlugin = new webpack.DefinePlugin({
module.exports = {
entry: {
app: path.resolve(__dirname, 'src/main.js'),
vendor: ['phaser', 'phaser-plugin-update', '@babel/polyfill']
vendor: ['phaser', 'phaser-plugin-update', 'three', '@babel/polyfill']
},
output: {
path: path.resolve(__dirname, 'dist'),
Expand Down Expand Up @@ -65,6 +65,7 @@ module.exports = {
}),
new MinifyPlugin({}, { comments: false }),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.ProvidePlugin({ THREE: 'three' }),
new BrowserSyncPlugin({
host: process.env.IP || 'localhost',
port: process.env.PORT || 3000,
Expand All @@ -84,7 +85,7 @@ module.exports = {
},
resolve: {
alias: {
'phaser': phaser
phaser: Phaser
}
}
}

0 comments on commit 671aa5f

Please sign in to comment.