我有一个使用Gulp和Webpack的开发环境 . 使用Gulp的唯一目的是使用ReactJS(我已经工作)为主题开发提供Ghost服务器 . Webpack的目的是为我的项目编译和提供我的依赖项 . 截至目前,我无法在我的测试主题中加载捆绑的 .js
文件 . 我'm curious if this is a Webpack issue by itself, that it either can' t加载 .hbs
文件或我的配置中的某些东西搞砸了 .
Ghost服务器加载正常,但当我切换到主题时,我发现我的捆绑 .js
文件带有404.我在想:
-
我没有配置Webpack来正确提供
.hbs
文件 . -
我确实将Webpack配置为正确提供
.hbs
文件,但我的配置一般都搞砸了 . -
目前Webpack是不可能的
我想在服务的 .hbs
文件中加载我的捆绑 .js
以获取Ghost主题 .
我已经为我的项目提供了一个例子 . 只需按照超级简单的设置,你就可以去了 .
项目设置
My-Project
|--/gulp
|--/dev-tasks //individual dev gulp tasks
|-ghost.js //Initializes Ghost config, run's sequence of tasks for webpack-dev-server
|-init.js //triggers symlinking of Ghost theme
|-sequence.js //maps out sequence of Gulp tasks
|-styles.js //style compiling
|-symlink.js //links local theme with Ghost configuration in /node_modules/
|-task-runner.js //runs Gulp tasks
|-webpack-build-dev.js // Loads the dev compiler
|-webpack-build-prod.js // Not worrying about this one...
|-webpack-dev-server.js // Runs the devServer
|-ghost-dev-config.js //configures Ghost environment
|--/public
|-default.hbs
|-index.hbs
|-package.json
|--/src
|--/containers
|-App.js
|-Home.js
|-StyleGuide.js
|-Uploader.js
|--/styles
|-main.sass
|-router.js
|-gulpfile.js
|-package.json
|-webpack.dev.config.js
|-webpack.prod.config.js
我正在尝试实现的目前还没有得到Webpack的支持吗?我可以通过使用Gulp和Browserfiy来解决问题,但我希望能够解决这个问题并使Webpack能够满足我的需求 .