Last active
January 21, 2019 12:22
-
-
Save panayotoff/f75c926834f3d9751599aa1f0db72049 to your computer and use it in GitHub Desktop.
Laravel Mix wordpress config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File webpack.mix.js | |
const mix = require('laravel-mix'); | |
const PATHS = { | |
src: 'src', | |
dist: '.', | |
proxy: 'http://localhost:8888/project' | |
}; | |
mix | |
.disableSuccessNotifications() | |
.setPublicPath(PATHS.dist) | |
.options({ processCssUrls: false }) | |
.js(`${PATHS.src}/js/app.js`, `${PATHS.dist}/assets/js`) | |
.sass(`${PATHS.src}/scss/style.scss`, `${PATHS.dist}/assets/css`) | |
.browserSync({ | |
ui: false, | |
injectChanges: true, | |
notify: false, | |
host: 'localhost', | |
port: 5858, | |
proxy: `${PATHS.proxy}`, | |
logLevel: 'silent', | |
files: [`${PATHS.dist}/*.*`] | |
}); | |
// End file | |
( | |
// File package.json | |
{ | |
"name": "WP starter", | |
"version": "1.0.0", | |
"main": "index.js", | |
"author": "Chris <chris@onload.agency>", | |
"license": "MIT", | |
"scripts": { | |
"serve": "yarn watch", | |
"build": "yarn production", | |
"dev": "yarn development", | |
"development": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"watch-poll": "yarn watch -- --watch-poll", | |
"hot": "NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"production": "NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
"img:optim" : "imageoptim './assets/**/*(.jpg|.jpeg|.png)'", | |
"wp:langs" : "wp i18n make-pot . languages/domain.pot" | |
}, | |
"devDependencies": { | |
"browser-sync": "^2.24.7", | |
"browser-sync-webpack-plugin": "^2.2.2", | |
"laravel-mix": "^2.1.14" | |
} | |
} // End file | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment