Сейчас в данный момент конфиг такой:
Код: Выделить всё
const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
entry: './views/src/app.js',
output: {
path: path.resolve(__dirname, 'web/dist'),
filename: 'js/bundle.js'
},
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
}
]
},
plugins: [
new ExtractTextPlugin('css/style.css'),
new BrowserSyncPlugin({
host: 'localhost',
port: 3000,
proxy:'http://mcp.aza/web/',
//server: { baseDir: ['web'] },
notify: false,
files: [{
match: [
'web/index.php',
'**/*.css',
'**/*.js',
'**/*.twig',
],
fn: function(event, file) {
if (event === 'change') {
const bs = require('browser-sync').get('bs-webpack-plugin');
bs.reload();
}
},
}],
}),
]
};
Код: Выделить всё
{
"name": "myaza",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --progress --colors ",
"start": "webpack --watch && npm run dev"
},
"author": "aza",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.26.3",
"browser-sync-webpack-plugin": "^2.2.2",
"cross-env": "^5.2.0",
"css-loader": "^2.1.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.28.4",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14"
}
}
В данный момент автокомпил не работает и автоподгрузка