Compare commits
No commits in common. "fb63356f102b3ad2c0500e56bcd3253831c16125" and "89738ad9b75903ab782b407390e46619699b2563" have entirely different histories.
fb63356f10
...
89738ad9b7
File diff suppressed because one or more lines are too long
|
@ -48,7 +48,6 @@
|
||||||
"execa": "^0.10.0",
|
"execa": "^0.10.0",
|
||||||
"file-loader": "^1.1.11",
|
"file-loader": "^1.1.11",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"image-webpack-loader": "^4.3.1",
|
|
||||||
"jimp": "^0.2.28",
|
"jimp": "^0.2.28",
|
||||||
"mini-css-extract-plugin": "^0.4.1",
|
"mini-css-extract-plugin": "^0.4.1",
|
||||||
"node-sass": "^4.9.2",
|
"node-sass": "^4.9.2",
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 328 KiB |
|
@ -48,7 +48,7 @@
|
||||||
opacity: $icedream-fog-base-opacity + ($icedream-fog-base-opacity * .5);
|
opacity: $icedream-fog-base-opacity + ($icedream-fog-base-opacity * .5);
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
opacity: $icedream-fog-base-opacity - ($icedream-fog-base-opacity * .05);
|
opacity: $icedream-fog-base-opacity - ($icedream-fog-base-opacity * .0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@keyframes icedream-bg-slide {
|
@keyframes icedream-bg-slide {
|
||||||
|
|
|
@ -40,8 +40,6 @@ const {
|
||||||
ModuleConcatenationPlugin,
|
ModuleConcatenationPlugin,
|
||||||
} = optimize;
|
} = optimize;
|
||||||
|
|
||||||
const dj = 'icedream';
|
|
||||||
|
|
||||||
export default (options, { mode }) => {
|
export default (options, { mode }) => {
|
||||||
const environment = new Environment({
|
const environment = new Environment({
|
||||||
// @HACK
|
// @HACK
|
||||||
|
@ -61,62 +59,39 @@ export default (options, { mode }) => {
|
||||||
docker,
|
docker,
|
||||||
} = environment;
|
} = environment;
|
||||||
|
|
||||||
const baseOutputFilepath = 'static/theme/[type]/[filename]';
|
const baseOutputFilename = development
|
||||||
const filenames = {
|
? 'assets/dev/[name].dev.[ext]'
|
||||||
css: '[name].[ext]',
|
// Always use a hash (in production) to prevent files with the same name causing issues
|
||||||
default: development
|
: 'assets/prod/[chunkhash:2]/[name].[chunkhash:8].[ext]';
|
||||||
? '[name].dev.[ext]'
|
|
||||||
// Always use a hash (in production) to prevent files with the same name causing issues
|
|
||||||
: '[name].[chunkhash:8].[ext]',
|
|
||||||
};
|
|
||||||
|
|
||||||
function replaceField(string, name, value) {
|
const webpackChunkFilename = baseOutputFilename
|
||||||
const retval = string.replace(new RegExp(`\\[${name}(.*?)\\]`), value);
|
.replace(/\[ext(.*?)\]/g, 'js');
|
||||||
debug('replaceField:', { args: { string, name, value } }, string, '=>', retval);
|
const webpackOutputFilename = webpackChunkFilename;
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getOutputFilename(type) {
|
const assetOutputFilename = baseOutputFilename
|
||||||
let filename = baseOutputFilepath;
|
.replace(/\[chunkhash(.*?)\]/g, '[hash$1]');
|
||||||
switch (type) {
|
|
||||||
case 'css':
|
|
||||||
filename = replaceField(filename, 'type', type);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
filename = replaceField(filename, 'type', `${type}/${dj}`);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
filename = replaceField(filename, 'filename', filenames[type] || filenames.default);
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAssetOutputFilename(type) {
|
const cssOutputFileName = baseOutputFilename
|
||||||
let filename = getOutputFilename(type);
|
|
||||||
filename = replaceField(filename, 'chunkhash', '[hash$1]');
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cssOutputFileName = getOutputFilename('css')
|
|
||||||
.replace(/\[ext(.*?)\]/g, 'css');
|
.replace(/\[ext(.*?)\]/g, 'css');
|
||||||
// .replace(/\[chunkhash(.*?)\]/g, '[contenthash$1]');
|
// .replace(/\[chunkhash(.*?)\]/g, '[contenthash$1]');
|
||||||
const cssChunkOutputFileName = getOutputFilename('css')
|
const cssChunkOutputFileName = baseOutputFilename
|
||||||
.replace(/\[chunkhash(.*?)\]/g, '[id$1]')
|
.replace(/\[chunkhash(.*?)\]/g, '[id$1]')
|
||||||
.replace(/\[ext(.*?)\]/g, 'css');
|
.replace(/\[ext(.*?)\]/g, 'css');
|
||||||
// const cssOutputRebasePath = `${slash(path.relative(path.dirname(cssOutputFileName), ''))}/`;
|
// const cssOutputRebasePath = `${slash(path.relative(path.dirname(cssOutputFileName), ''))}/`;
|
||||||
const cssOutputRebasePath = '../../../';
|
const cssOutputRebasePath = '/';
|
||||||
|
|
||||||
// Default options for file-loader
|
// Default options for file-loader
|
||||||
const getFileLoaderOptions = type => ({
|
const fileLoaderOptions = {
|
||||||
name: getAssetOutputFilename(type),
|
name: assetOutputFilename,
|
||||||
publicPath: cssOutputRebasePath,
|
publicPath: cssOutputRebasePath,
|
||||||
});
|
};
|
||||||
|
|
||||||
// Default options for url-loader
|
// Default options for url-loader
|
||||||
const getUrlLoaderOptions = type => ({
|
const urlLoaderOptions = {
|
||||||
...getFileLoaderOptions(type),
|
...fileLoaderOptions,
|
||||||
// limit: 1, // Don't inline anything (but empty files) by default
|
// limit: 1, // Don't inline anything (but empty files) by default
|
||||||
limit: 4 * 1024,
|
limit: 4 * 1024,
|
||||||
});
|
};
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
name: 'frontend',
|
name: 'frontend',
|
||||||
|
@ -193,57 +168,22 @@ export default (options, { mode }) => {
|
||||||
/\.jpe?g$/i, // jpeg
|
/\.jpe?g$/i, // jpeg
|
||||||
].map(test => ({
|
].map(test => ({
|
||||||
test,
|
test,
|
||||||
use: [
|
loader: 'url-loader',
|
||||||
{
|
options: {
|
||||||
loader: 'url-loader',
|
...urlLoaderOptions,
|
||||||
options: {
|
// fallback: 'responsive-loader',
|
||||||
...getUrlLoaderOptions('img'),
|
},
|
||||||
// fallback: 'responsive-loader',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
loader: 'image-webpack-loader',
|
|
||||||
options: {
|
|
||||||
mozjpeg: {
|
|
||||||
progressive: true,
|
|
||||||
quality: 80,
|
|
||||||
},
|
|
||||||
optipng: {
|
|
||||||
enabled: true,
|
|
||||||
optimizationLevel: 7,
|
|
||||||
},
|
|
||||||
pngquant: {
|
|
||||||
enabled: false,
|
|
||||||
quality: '65-85',
|
|
||||||
speed: 2,
|
|
||||||
strip: true,
|
|
||||||
},
|
|
||||||
gifsicle: {
|
|
||||||
interlaced: false,
|
|
||||||
},
|
|
||||||
disable: development,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})),
|
})),
|
||||||
|
|
||||||
...[
|
...[
|
||||||
/\.(mp4|ogg|webm)$/i, // video
|
/\.(mp4|ogg|webm)$/i, // video
|
||||||
|
/\.(eot|otf|ttf|woff|woff2)$/i, // fonts
|
||||||
/\.(wav|mp3|m4a|aac|oga)$/i, // audio
|
/\.(wav|mp3|m4a|aac|oga)$/i, // audio
|
||||||
].map(test => ({
|
].map(test => ({
|
||||||
test,
|
test,
|
||||||
loader: 'url-loader',
|
loader: 'url-loader',
|
||||||
options: getUrlLoaderOptions('media'),
|
options: urlLoaderOptions,
|
||||||
})),
|
})),
|
||||||
|
|
||||||
...[
|
|
||||||
/\.(eot|otf|ttf|woff|woff2)$/i, // fonts
|
|
||||||
].map(test => ({
|
|
||||||
test,
|
|
||||||
loader: 'url-loader',
|
|
||||||
options: getUrlLoaderOptions('font'),
|
|
||||||
})),
|
|
||||||
|
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
use: environment.styleLoaders(),
|
use: environment.styleLoaders(),
|
||||||
|
@ -265,8 +205,8 @@ export default (options, { mode }) => {
|
||||||
},
|
},
|
||||||
|
|
||||||
output: {
|
output: {
|
||||||
filename: replaceField(getOutputFilename('js'), 'ext', 'js'),
|
filename: webpackOutputFilename,
|
||||||
chunkFilename: replaceField(getOutputFilename('js'), 'ext', 'js'),
|
chunkFilename: webpackChunkFilename,
|
||||||
path: path.join(__dirname, 'dist'),
|
path: path.join(__dirname, 'dist'),
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
globalObject: 'this', // https://github.com/webpack-contrib/worker-loader/issues/142#issuecomment-385764803
|
globalObject: 'this', // https://github.com/webpack-contrib/worker-loader/issues/142#issuecomment-385764803
|
||||||
|
@ -397,7 +337,7 @@ export default (options, { mode }) => {
|
||||||
},
|
},
|
||||||
devtool: server ? 'cheap-module-source-map' : 'source-map',
|
devtool: server ? 'cheap-module-source-map' : 'source-map',
|
||||||
entry: {
|
entry: {
|
||||||
[dj]: [
|
app: [
|
||||||
path.join(__dirname, 'src'),
|
path.join(__dirname, 'src'),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue