Skip to content

Commit 6ac148b

Browse files
committed
Add .env support
1 parent b438887 commit 6ac148b

File tree

7 files changed

+25
-79
lines changed

7 files changed

+25
-79
lines changed

.codeception.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extensions:
1010
- Codeception\Extension\RunFailed
1111
params:
1212
- env
13-
- .codeception/_config/params.php
13+
- .env.development
1414
settings:
1515
backup_globals: false
1616
colors: true

.codeception/_config/params.example.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

.codeception/_config/params.github-actions.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

.codeception/_config/params.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

.env.development

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
WP_URL="http://wpplugin.local"
2+
WP_ADMIN_USERNAME="admin"
3+
WP_ADMIN_PASSWORD="pass"
4+
WP_ADMIN_PATH="/wp-admin"
5+
DB_HOST="127.0.0.1"
6+
DB_NAME="local"
7+
DB_USER="root"
8+
DB_PASSWORD="root"
9+
DB_TABLE_PREFIX="wp_"

.env.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
WP_URL="http://wpplugin.local"
2+
WP_ADMIN_USERNAME="admin"
3+
WP_ADMIN_PASSWORD="pass"
4+
WP_ADMIN_PATH="/wp-admin"
5+
DB_HOST="127.0.0.1"
6+
DB_NAME="local"
7+
DB_USER="root"
8+
DB_PASSWORD="root"
9+
DB_TABLE_PREFIX="wp_"

.webpack.mix.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
const mix = require( 'laravel-mix' ),
2-
path = require( 'path' );
2+
path = require( 'path' ),
3+
envFile = '.env.' + process.env.NODE_ENV;
34

5+
require( 'mix-env-file' );
46
require( 'laravel-mix-purgecss' );
57
require( 'laravel-mix-copy-watched' );
68

9+
mix.env( envFile );
10+
711
mix
812
.setPublicPath( './assets/build' )
9-
.browserSync( 'wp-punk.com' ); // Change domain to the domain for the current project.
13+
.browserSync( process.env.WP_URL ); // Change domain to the domain for the current project.
1014

1115
mix
1216
.sass( 'assets/.src/scss/admin/settings.scss', 'css/admin' )

0 commit comments

Comments
 (0)