Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fixes #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const paths = [
];

const buildpath = {
main: './public',
js: './public/js',
css: './public/css',
images: './public/images/'
main: '.',
js: './js',
css: './css',
images: './images/'
};

const webpackCommonConfig = {
Expand All @@ -29,8 +29,8 @@ const webpackCommonConfig = {
'style-rtl': './src/assets/sass/style-rtl.scss'
},
output: {
filename: './src/js/[name].js',
path: path.resolve(buildpath.main),
filename: './js/[name].js',
path: path.resolve(`./public/${buildpath.main}`),
publicPath: path.resolve('./public')
},
module: {
Expand Down Expand Up @@ -62,7 +62,10 @@ const webpackCommonConfig = {
publicPath: '/'
}
},
'css-loader',
{
loader: 'css-loader',
options: { url: false }
},
'postcss-loader',
'sass-loader'
]
Expand All @@ -84,9 +87,9 @@ const webpackCommonConfig = {
partials: [
path.join(process.cwd(), 'src', 'partials', '**', '*.html')
],
getPartialId: (filePath) => filePath.match(`^${path.resolve('.')}/src/partials/(.+).html`).pop(),
getPartialId: (filePath) => filePath.match(`^${path.resolve('.').replace(/\\/g, '/')}/src/partials/(.+).html`).pop(),
helpers: {
...HandlebarsHelpers,
...HandlebarsHelpers(),
inlineArray: (...args) => args.slice(0, -1)
}
}),
Expand All @@ -95,7 +98,7 @@ const webpackCommonConfig = {
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS
}),
new MiniCssExtractPlugin({
filename: './src/css/[name].css'
filename: './css/[name].css'
}),
new SitemapPlugin({
base: 'https://prototype.net',
Expand Down