maven 打包vue配置记录

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28114645/article/details/81392826

pom.xml插件配置

 <plugin>
                <!-- https://mvnrepository.com/artifact/com.github.eirslett/frontend-maven-plugin -->
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v6.11.1</nodeVersion>
                            <npmVersion>3.10.10</npmVersion>
                        </configuration>
                    </execution>
                     <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm run dev</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run dev</arguments>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <installDirectory>/var/temp</installDirectory>
                    <workingDirectory>web</workingDirectory>
                </configuration>
            </plugin>

项目paths.js配置

// config after eject: we're in ./config/
module.exports = {
  dotenv: resolveApp('.env'),
  appBuild: resolveApp('打包的位置'),
  appPublic: resolveApp('打包的位置'),
  appHtml: resolveApp('public/index.html'),
  appIndexJs: resolveApp('src/index.js'),
  appPackageJson: resolveApp('package.json'),
  appSrc: resolveApp('src'),
  yarnLockFile: resolveApp('yarn.lock'),
  testsSetup: resolveApp('src/setupTests.js'),
  appNodeModules: resolveApp('node_modules'),
  publicUrl: getPublicUrl(resolveApp('package.json')),
  servedPath: getServedPath(resolveApp('package.json')),
};

webpack.config.prod.js配置

plugins: [
  new webpack.DllReferencePlugin({
    context: __dirname,
    manifest: require('../dll/vendor-manifest.json'),
  }),
  new CopyWebpackPlugin([
    {from: path.resolve(__dirname,'../dll'),
      to:path.resolve(__dirname,'打包的相对位置')}
  ]),

猜你喜欢

转载自blog.csdn.net/qq_28114645/article/details/81392826