diff --git a/packages/slate-tools/slate-tools.config.js b/packages/slate-tools/slate-tools.config.js index cbbb61a3d..261cd7903 100644 --- a/packages/slate-tools/slate-tools.config.js +++ b/packages/slate-tools/slate-tools.config.js @@ -8,7 +8,7 @@ module.exports = generate({ items: [ { id: 'webpackCommonExcludes', - default: ['node_modules', 'assets/vendors/'], + default: ['node_modules', 'assets/static/'], description: 'Paths to exclude for all webpack loaders', type: 'array', }, @@ -81,8 +81,8 @@ module.exports = generate({ default: resolveTheme('src'), }, { - id: 'vendors', - default: resolveTheme('src/assets/vendors'), + id: 'static', + default: resolveTheme('src/assets/static'), }, { id: 'scripts', diff --git a/packages/slate-tools/tools/webpack/config/core.js b/packages/slate-tools/tools/webpack/config/core.js index 66c9944c2..8a8b6fea0 100755 --- a/packages/slate-tools/tools/webpack/config/core.js +++ b/packages/slate-tools/tools/webpack/config/core.js @@ -3,9 +3,9 @@ const path = require('path'); const webpack = require('webpack'); const WriteFileWebpackPlugin = require('write-file-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); const commonExcludes = require('../common-excludes'); const babelLoader = require('../loaders/babel-loader'); -const ExtractTextPlugin = require('extract-text-webpack-plugin'); const config = require('../../../slate-tools.config'); const {entrypointFiles} = require('../entrypoints'); @@ -18,7 +18,7 @@ const extractLiquidStyles = new ExtractTextPlugin( /** * Return an array of ContextReplacementPlugin to use. - * Omit the __appvendors__ replacement if the directory does not exists. + * Omit the __appstatic__ replacement if the directory does not exists. * * @see https://webpack.js.org/plugins/context-replacement-plugin/#newcontentcallback */ @@ -37,11 +37,11 @@ function contextReplacementPlugins() { ), ]; - if (fs.existsSync(paths.vendors)) { + if (fs.existsSync(paths.static)) { plugins.push( new webpack.ContextReplacementPlugin( - /__appvendors__/, - replaceCtxRequest(paths.vendors), + /__appstatic__/, + replaceCtxRequest(paths.static), ), ); } @@ -117,7 +117,7 @@ module.exports = { }, }, { - test: /assets\/vendors\//, + test: /assets\/static\//, exclude: /node_modules/, loader: 'file-loader', options: { diff --git a/packages/slate-tools/tools/webpack/static-files-glob.js b/packages/slate-tools/tools/webpack/static-files-glob.js index d2dfea60a..97e2b99dd 100644 --- a/packages/slate-tools/tools/webpack/static-files-glob.js +++ b/packages/slate-tools/tools/webpack/static-files-glob.js @@ -5,7 +5,7 @@ // // This is used as an entry point in webpack.base.conf.js. It dynamically // require all liquid and json files from the user's directory (except theme.liquid) -// as well as everything inside the src/assets/vendors directory. +// as well as everything inside the src/assets/static directory. // // Why not use require.context() you ask ? This would work if we'd want to require // files from this tool's directory, but not from the user's directory, as you can't @@ -21,11 +21,11 @@ // // For the `ContextReplacementPlugin` to kick in, we need to make our require // dynamic, hence the use of a variable (`dynamicCtx`). -// The context we look for, and replace, is the `__app[src|vendors]__` part. +// The context we look for, and replace, is the `__app[src|static]__` part. // var dynamicCtx = 'salut'; require('__appsrc__/layout' + dynamicCtx + '.liquid'); require('__appsrc__/sections' + dynamicCtx + '.liquid'); require('__appsrc__/snippets' + dynamicCtx + '.liquid'); require('__appsrc__/templates' + dynamicCtx + '.liquid'); -require('__appvendors__/' + dynamicCtx); +require('__appstatic__/' + dynamicCtx);