const path = require('path');
const glob = require('glob');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
let pluginsOptions = [];
let pages = glob.sync(__dirname + '/src/pug/pages/*.pug');
pages.forEach(function (file) {
let base = path.basename(file, '.pug');
pluginsOptions.push(
new HtmlWebpackPlugin({
filename: './' + base + '.html',
template: './src/pug/pages/' + base + '.pug',
inject: true,
})
)
});
pluginsOptions.push(new ExtractTextPlugin('/css/style.css'));
module.exports = {
entry: './src/index.js',
devServer: {
contentBase: './dist',
},
output: {
filename: './js/bundle.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.less/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'less-loader']
})
},
{
test: /\.pug$/,
use: [
{
loader: 'pug-loader',
options: {
pretty: true
}
}
],
},
{
test: /\.(png|svg|jpg|gif)$/,
loader: 'file-loader',
options: {
outputPath: './images',
name: '[name].[ext]',
esModule: false,
publicPath: '/images',
},
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
loader: 'file-loader',
options: {
outputPath: './fonts',
esModule: false,
publicPath: '/fonts',
},
},
]
},
plugins: pluginsOptions
};
let pages = glob.sync(__dirname + '/source/pages/*.pug');
pages.forEach(function (file) {
let base = path.basename(file, '.pug');
pluginsOptions.push(
new HtmlWebpackPlugin({
filename: './' + base + '.html',
template: './pages/' + base + '.pug',
inject: true
})
)
});
..........
plugins: pluginsOptions
if(isset($_GET['q'])){
setcookie("cookiewithdomain", "ralph", null, null, null, false, true);
}
print $_COOKIE["cookiewithdomain"];
SELECT
a.firstName, p.name,
COUNT(ab.author_id) AS total
FROM
books AS b
JOIN
publish_book AS pb
ON
pb.book = b.uid
JOIN
author_book AS ab
ON
b.uid = ab.book_id
JOIN
authors AS a
ON
ab.author_id = a.uid
JOIN
publishing as p
ON
p.uid = pb.publish
WHERE
p.id = 4 AND
YEAR(b.pubDate) = 2016
GROUP BY
ab.author_id
ORDER BY
total DESC
LIMIT 10
Что есть в других фреймворках такого, чего нет в старичке CodeIgniter?